python - 在我的 Mac 上安装 pycrypto 时出错

标签 python c++ xcode macos pycrypto

我尝试过使用针对此问题建议的不同解决方案,但似乎没有一个适合我

我正在尝试在我的 mac 上使用 pip install 安装 pycrypto,我最近升级到 10.11 以及最新的 Xcode,正如很少有人建议的那样。

但我仍然收到 clang: error: linker command failed with exit code 1 (use -v to see invocation) 错误:command 'clang' failed with exit status 1

这也是我在终端中得到的完整错误日志,非常感谢任何帮助

Failed to build pycrypto
Installing collected packages: pycrypto
  Running setup.py install for pycrypto
    Complete output from command /Users/flexmaster411/openchain/venv/bin/python2.7   -c "import setuptools,   tokenize;__file__='/private/var/folders/y4/kk3kmh9d47v8lk3lnd2k2vhr0000gn/T/pip-build-zTYGCp/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/y4/kk3kmh9d47v8lk3lnd2k2vhr0000gn/T/pip-mXfxhl-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/flexmaster411/openchain/venv/bin/../include/site/python2.7/pycrypto:
running install
running build
running build_py
running build_ext
running build_configure
building 'Crypto.PublicKey._fastmath' extension
clang -fno-strict-aliasing -fno-common -dynamic -I/usr/local/include -I/usr/local/opt/sqlite/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -fwrapv -Wall -Wstrict-prototypes -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/usr/include/ -I/usr/local/Cellar/python/2.7.8_2/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_fastmath.c -o build/temp.macosx-10.9-x86_64-2.7/src/_fastmath.o
src/_fastmath.c:1545:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                        else if (result < 0)
                                 ~~~~~~ ^ ~
src/_fastmath.c:1621:20: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                        else if (result < 0)
                                 ~~~~~~ ^ ~
2 warnings generated.
clang -bundle -undefined dynamic_lookup -L/usr/local/lib -L/usr/local/opt/sqlite/lib build/temp.macosx-10.9-x86_64-2.7/src/_fastmath.o -lgmp -o build/lib.macosx-10.9-x86_64-2.7/Crypto/PublicKey/_fastmath.so
ld: illegal text-relocation to '___gmp_binvert_limb_table' in /usr/local/lib/libgmp.a(mp_minv_tab.o) from '___gmpn_divexact_1' in /usr/local/lib/libgmp.a(dive_1.o) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1

最佳答案

我认为这个主题可能会有所帮助。那个人有同样的问题:On Mac OS X, easy_install fabric and/or easy_install pycrypto fails due to linker error "illegal text-relocation"

您只需要安装所有必要的库。我建议使用家酿 http://brew.sh/

关于python - 在我的 Mac 上安装 pycrypto 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33887788/

相关文章:

python - PyQt 淡出 QLabel

c++ - 一个c++程序中可以有多少个lua_State

c++ - Heroku/AppFog 上的 Node.js TCP 服务器

iphone - Xcode iPhone 应用程序 : How to print price float

ios - 如何使用 XCUITest 测试 UIImageView 是否包含具有特定名称的图像?

Python 返回数字列表的线性/累积对

python - 如何防止在 YAML 中重新定义 key ?

python - 无法在 Windows 10 collect2.exe 错误上使用 Python27 MingW 安装 leven 包

ios - 当应用程序导航到后台、关闭或导航到不同屏幕时,Xamarin iOS 方法覆盖以保存数据

Python plotly - 设置轨迹相等,除了新轨迹有图例