0

I am trying to install numpy on a macOS Big Sur but got this error. I've tried update pip and setuptool, also update xcode, but the error still appears

ERROR: Command errored out with exit status 1:


 command: /Users/mac/opt/miniconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/24/2bgc31xs4w51ksff8v5kphcc0000gn/T/pip-install-3jq2_h06/numpy_a0d6a6e5f34d4b3b887afd79c04b5c7c/setup.py'"'"'; __file__='"'"'/private/var/folders/24/2bgc31xs4w51ksff8v5kphcc0000gn/T/pip-install-3jq2_h06/numpy_a0d6a6e5f34d4b3b887afd79c04b5c7c/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/24/2bgc31xs4w51ksff8v5kphcc0000gn/T/pip-wheel-hvs0y1qx
       cwd: /private/var/folders/24/2bgc31xs4w51ksff8v5kphcc0000gn/T/pip-install-3jq2_h06/numpy_a0d6a6e5f34d4b3b887afd79c04b5c7c/

...

error: Command "gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/mac/opt/miniconda3/include -arch x86_64 -I/Users/mac/opt/miniconda3/include -arch x86_64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1 -D_LARGEFILE64_SOURCE=1 -Inumpy/core/include -Ibuild/src.macosx-10.9-x86_64-3.7/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/src/npysort -I/Users/mac/opt/miniconda3/include/python3.7m -Ibuild/src.macosx-10.9-x86_64-3.7/numpy/core/src/private -Ibuild/src.macosx-10.9-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.macosx-10.9-x86_64-3.7/numpy/core/src/private -Ibuild/src.macosx-10.9-x86_64-3.7/numpy/core/src/npymath -Ibuild/src.macosx-10.9-x86_64-3.7/numpy/core/src/private -Ibuild/src.macosx-10.9-x86_64-3.7/numpy/core/src/npymath -c numpy/random/mtrand/mtrand.c -o build/temp.macosx-10.9-x86_64-3.7/numpy/random/mtrand/mtrand.o -MMD -MF build/temp.macosx-10.9-x86_64-3.7/numpy/random/mtrand/mtrand.o.d" failed with exit status 1

Also when pip trying to reinstall numpy, error messages appears like this

ERROR: Command errored out with exit status 1: /Users/mac/opt/miniconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/24/2bgc31xs4w51ksff8v5kphcc0000gn/T/pip-install-3jq2_h06/numpy_a0d6a6e5f34d4b3b887afd79c04b5c7c/setup.py'"'"'; __file__='"'"'/private/var/folders/24/2bgc31xs4w51ksff8v5kphcc0000gn/T/pip-install-3jq2_h06/numpy_a0d6a6e5f34d4b3b887afd79c04b5c7c/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/24/2bgc31xs4w51ksff8v5kphcc0000gn/T/pip-record-4yafo15v/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mac/opt/miniconda3/include/python3.7m/numpy Check the logs for full command output.

Any Ideas?

1
  • Show us the exact command you invoke to install numpy Commented Jan 14, 2021 at 10:05

2 Answers 2

1

Looks like gcc compiler or some system library dependencies problem.

Here is mine gcc version (MacOS Catalina)

$ which gcc
/usr/bin/gcc
$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.16)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Are your macbook architecture is x86_64? If that is new ARM64 one, architecture may be a reason.

Also build/temp.macosx-10.9-x86_64-3.7/... and build/src.macosx-10.9-x86_64-3.7/... looking pretty old (OS X 10.9?). I'm not familiar with pip build processes, but looks like python 3.7.X libraries don't updated long time. Newer python version is 3.9.X. Try to use it, that may be solution.

Sign up to request clarification or add additional context in comments.

Comments

0

According to similar problem in this link (https://github.com/numpy/numpy/issues/12026). You installation tries to compile numpy on your system, which is not necessary. Try to install concrete version of numpy, e.g. pip3 install numpy==1.19.5

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.