首页 > 解决方案 > python包的`pip`安装问题

问题描述

我正在尝试安装一个python名为numba. 我想安装它python2.7,所以当我运行时sudo pip2.7 install numba,它会给出以下消息。谁能让我知道问题是什么?谢谢你。

copying numba/tests/pycc_distutils_usecase/source_module.py -> build/lib.macosx-10.13-intel-2.7/numba/tests/pycc_distutils_usecase
    running build_ext
    building 'numba._dynfunc' extension
    C compiler: cc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -arch i386 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe

creating build/temp.macosx-10.13-intel-2.7
creating build/temp.macosx-10.13-intel-2.7/numba
compile options: '-I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
cc: numba/_dynfuncmod.c
cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.13-intel-2.7/numba/_dynfuncmod.o -o build/lib.macosx-10.13-intel-2.7/numba/_dynfunc.so
ld: in '/usr/local/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libunwind.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: in '/usr/local/lib/libunwind.dylib', file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libunwind.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: Command "cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.13-intel-2.7/numba/_dynfuncmod.o -o build/lib.macosx-10.13-intel-2.7/numba/_dynfunc.so" failed with exit status 1

----------------------------------------
Command "/System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -c "import setuptools, 
tokenize;__file__='/private/tmp/pip-build-mt0h4y/numba/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" 
install --record /tmp/pip-yCTE4v-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-mt0h4y/numba

标签: pythonpipnumba

解决方案


这对我有用

 env ARCHFLAGS="-arch x86_64"  pip install python-binance

推荐阅读