升级到OS X Yosemite后,我无法pip install pandas
或pip install numpy
。两个命令之前都运行良好。我跑的时候
$ pip install numpy
编译过程运行大约30秒然后我得到了这个:
编译C源
C compiler: cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -arch x86_64 -arch i386 -pipe
creating build/temp.macosx-10.10-intel-2.7/numpy/linalg
creating build/temp.macosx-10.10-intel-2.7/numpy/linalg/lapack_lite
compile options: '-DATLAS_INFO="\"3.9.35\"" -I/opt/local/include -Inumpy/core/include -Ibuild/src.macosx-10.10-intel-2.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 -Inumpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -Ibuild/src.macosx-10.10-intel-2.7/numpy/core/src/private -Ibuild/src.macosx-10.10-intel-2.7/numpy/core/src/private -Ibuild/src.macosx-10.10-intel-2.7/numpy/core/src/private -Ibuild/src.macosx-10.10-intel-2.7/numpy/core/src/private -c'
cc: numpy/linalg/lapack_lite/python_xerbla.c
cc: numpy/linalg/lapack_litemodule.c
/usr/local/bin/gfortran -Wall -g -arch x86_64 -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.10-intel-2.7/numpy/linalg/lapack_litemodule.o build/temp.macosx-10.10-intel-2.7/numpy/linalg/lapack_lite/python_xerbla.o -L/opt/local/lib -L/usr/local/Cellar/gcc/4.9.1/lib/gcc/x86_64-apple-darwin14.0.0/4.9.1 -Lbuild/temp.macosx-10.10-intel-2.7 -llapack -lptf77blas -lptcblas -latlas -lgfortran -o build/lib.macosx-10.10-intel-2.7/numpy/linalg/lapack_lite.so
ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architecture x86_64
collect2: error: ld returned 1 exit status
ld: symbol dyld_stub_binding_helper not found, normally in crt1.o/dylib1.o/bundle1.o for architecture x86_64
collect2: error: ld returned 1 exit status
error: Command "/usr/local/bin/gfortran -Wall -g -arch x86_64 -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.10-intel-2.7/numpy/linalg/lapack_litemodule.o build/temp.macosx-10.10-intel-2.7/numpy/linalg/lapack_lite/python_xerbla.o -L/opt/local/lib -L/usr/local/Cellar/gcc/4.9.1/lib/gcc/x86_64-apple-darwin14.0.0/4.9.1 -Lbuild/temp.macosx-10.10-intel-2.7 -llapack -lptf77blas -lptcblas -latlas -lgfortran -o build/lib.macosx-10.10-intel-2.7/numpy/linalg/lapack_lite.so" failed with exit status 1
----------------------------------------
Cleaning up...
Command /Users/admin/.virtualenvs/numpy_env/bin/python -c "import setuptools, tokenize;__file__='/Users/admin/.virtualenvs/numpy_env/build/numpy/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/5b/1l8zg39d48d865bktn00qnbr0000gn/T/pip-yQOlkU-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/admin/.virtualenvs/numpy_env/include/site/python2.7 failed with error code 1 in /Users/admin/.virtualenvs/numpy_env/build/numpy
Storing debug log for failure in /var/folders/5b/1l8zg39d48d865bktn00qnbr0000gn/T/tmpuDgjp9
我尝试过升级Python,重新创建我的virtualenv,重新启动我的系统,并将我的头撞在桌面上,但没有人帮助过。我还运行了brew rm gfortran
,然后是brew install gcc
,但这并没有帮助。
答案 0 :(得分:2)
根据someone on twitter的建议,我跑了brew uninstall gcc
。这导致numpy安装使用XCode提供的gcc
。这似乎工作正常。
Homebrew安装gc 4.9,而Apple安装在4.2.1。但是,我不知道底层问题是什么。