install bottleneck by pip error (macos) ERROR: Failed building wheel for bottleneck; error: command 'gcc' failed with exit status 1

Related searches

I am installing bottleneck by python3 -m pip install bottleneck. My Python version is 3.7 and my system is Mac OS. I got the following errors:

Building wheel for bottleneck (setup.py) ... error 

and

error: command 'gcc' failed with exit status 1.

I have already installed the numpy and wheel packages.

Detailed message:

Collecting bottleneck
  Using cached https://files.pythonhosted.org/packages/05/ae/cedf5323f398ab4e4ff92d6c431a3e1c6a186f9b41ab3e8258dff786a290/Bottleneck-1.2.1.tar.gz
Requirement already satisfied: numpy in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages (from bottleneck) (1.16.2)
Building wheels for collected packages: bottleneck
  Building wheel for bottleneck (setup.py) ... error
  ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/5r/8xqw7gg166nbrf4xp234kfhw00ggg5/T/pip-install-85p6c0ma/bottleneck/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/5r/8xqw7gg166nbrf4xp234kfhw00ggg5/T/pip-wheel-6xd7l92k --python-tag cp37:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.9-x86_64-3.7
  creating build/lib.macosx-10.9-x86_64-3.7/bottleneck
  copying bottleneck/version.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck
  copying bottleneck/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck
  creating build/lib.macosx-10.9-x86_64-3.7/bottleneck/benchmark
  copying bottleneck/benchmark/bench_detailed.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/benchmark
  copying bottleneck/benchmark/autotimeit.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/benchmark
  copying bottleneck/benchmark/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/benchmark
  copying bottleneck/benchmark/bench.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/benchmark
  creating build/lib.macosx-10.9-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/reduce.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/nonreduce.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/move.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/slow
  copying bottleneck/slow/nonreduce_axis.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/slow
  creating build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/nonreduce_axis_test.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/scalar_input_test.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/reduce_test.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/util.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/move_test.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/input_modifcation_test.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/nonreduce_test.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  copying bottleneck/tests/list_input_test.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/tests
  creating build/lib.macosx-10.9-x86_64-3.7/bottleneck/src
  copying bottleneck/src/__init__.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/src
  copying bottleneck/src/template.py -> build/lib.macosx-10.9-x86_64-3.7/bottleneck/src
  copying bottleneck/LICENSE -> build/lib.macosx-10.9-x86_64-3.7/bottleneck
  running build_ext
  building 'bottleneck.reduce' extension
  creating build/temp.macosx-10.9-x86_64-3.7
  creating build/temp.macosx-10.9-x86_64-3.7/bottleneck
  creating build/temp.macosx-10.9-x86_64-3.7/bottleneck/src
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c bottleneck/src/reduce.c -o build/temp.macosx-10.9-x86_64-3.7/bottleneck/src/reduce.o -O2
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for bottleneck
  Running setup.py clean for bottleneck
Failed to build bottleneck
Installing collected packages: bottleneck
  Running setup.py install for bottleneck ... error
    ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/5r/8xqw7gg166nbrf4xp234kfhw00ggg5/T/pip-install-85p6c0ma/bottleneck/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/5r/8xqw7gg166nbrf4xp234kfhw00ggg5/T/pip-record-drpl_77t/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    running build_ext
    building 'bottleneck.reduce' extension
    creating build/temp.macosx-10.9-x86_64-3.7
    creating build/temp.macosx-10.9-x86_64-3.7/bottleneck
    creating build/temp.macosx-10.9-x86_64-3.7/bottleneck/src
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c bottleneck/src/reduce.c -o build/temp.macosx-10.9-x86_64-3.7/bottleneck/src/reduce.o -O2
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/5r/8xqw7gg166nbrf4xp234kfhw00ggg5/T/pip-install-85p6c0ma/bottleneck/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/5r/8xqw7gg166nbrf4xp234kfhw00ggg5/T/pip-record-drpl_77t/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/5r/8xqw7gg166nbrf4xp234kfhw00ggg5/T/pip-install-85p6c0ma/bottleneck/

Could you kindly let me know what I can do to fix the error and install the package?

The problem is that Xcode Command-line Tools needs to be updated.

Go back to your terminal:

xcode-select --install

You'll then receive:

xcode-select: note: install requested for command line developer tools
And be prompted in a window to update Xcode Command Line tools.

After the update is completed, open a new terminal window and your development tools should be returned.

Addition: With any major or semi-major update you'll need to update the command line tools in order to get them functioning properly again. Check Xcode with any update. This goes beyond Mojave...

After that restart your terminal

'ERROR: Could not build wheels for bottleneck which use PEP 517 , Hi, I'm installing Bottleneck by fastai lib in a Suse 12 sp4 server, but had Building wheel for Bottleneck (PEP 517) error ERROR: Command errored setup.py clean for Bottleneck Failed to build Bottleneck ERROR: Could but pip install -r requirements.txt worked for me on MacOS and in the docker� On further investigation, I found this pypa/pip#6256 which suggests the issue is that wheels simply aren't supported with PEP 517 builds. My best guess would be to pip install --upgrade pip setuptools wheel and that should resolve the issue.

The problem seems to be this:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), 
missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

It seems you don't have the Xcode command line tools installed. (You don't need to install Xcode, just the command line tools.)

Before installing bottleneck, try doing this first:

$ xcode-select --install
$ xcrun --version  # just to check if it's installed

Then try again with python3 -m pip install bottleneck.

Can't install on macOS with Apple-provided Python 3 � Issue #338 , To Reproduce Install Apple's Python 3 (part of Xcode command line Installation through pip3 on macOS fails on Bottleneck-1.3.2 installation. Output of Failure /T/pip-build-env-ugwrlitb/overlay --no-warn-script-location --no-binary setuptools, wheel, Cython ERROR: Could not install packages due to� Install via pip Latest setuptools and cl.exe ' failed with exit status 2 ----- ERROR: Failed building wheel for Bottleneck Failed to build Bottleneck ERROR: Could

Another way to resolve this is to download Windows SDK 10 (latest version). If this alone doesn't work then download Visual Studio 2019 (again whichever is the latest version). This updates the wheel process.

Bottleneck � PyPI, pip install . To install bottleneck on Windows, first install MinGW and add it to your system path. Then install Bottleneck with the command: python setup.py install� The venv setup using make KALDI=/xxx/kaldi fails on my system when building the python-package bottleneck. Here is the output: . venv/bin/activate && pip install -e ..

Python Wheels, Support is offered in pip >= 1.4 and setuptools >= 0.8 . Advantages of wheels. Faster installation for pure Python and native C extension packages. Avoids arbitrary PyPI currently allows uploading platform-specific wheels for Windows, macOS and Linux. Fantastic, a problem found is a problem fixed. The error message appears to just be a way of saying "building the wheel failed, for reasons like e.g. not being able to find OpenSSL in this specific case, but more generically the compiler or some other thing in the build toolchain exiting unsuccessfully". These appear to be the relevant pip source lines.

pip wheel — pip 20.2.1 documentation, Build Wheel archives for your requirements and dependencies. pip to build a wheel, setup.py must implement the bdist_wheel command with the Note that some packages are tricky to compile and may fail to install when Found a bug? To install Bottleneck on Linux, Mac OS X, et al.: $ pip install . To install bottleneck on Windows, first install MinGW and add it to your system path. Then install Bottleneck with the command: python setup.py install --compiler=mingw32

However, when you try to do pip install . on a project that has a custom build.py the build process fails with ERROR: Could not build wheels for seiya which use PEP 517 and cannot be installed directly

Comments
  • Possible duplicate of Error on "pip install -U channels" command using for otree (Running setup.py bdist_wheel for twisted ... error)
  • stackoverflow.com/…