python - easy_install pycrypto 的问题

标签 python pycrypto

我正在尝试使用 easy_install 在 osx 上安装 pycrypto,但出现以下错误:

easy_install pycrypto
Searching for pycrypto
Reading http://pypi.python.org/simple/pycrypto/
Reading http://pycrypto.sourceforge.net
Reading http://www.pycrypto.org/
Reading http://www.amk.ca/python/code/crypto
Best match: pycrypto 2.3
Downloading http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto/pycrypto-2.3.tar.gz
Processing pycrypto-2.3.tar.gz
Running pycrypto-2.3/setup.py -q bdist_egg --dist-dir /var/folders/3D/3D07iptvHZuzuYaeQDMFIU+++TI/-Tmp-/easy_install-00HgRU/pycrypto-2.3/egg-dist-tmp-BWGYsg
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
src/MD2.c:134: fatal error: error writing to -: Broken pipe
compilation terminated.
lipo: can't open input file: /var/folders/3D/3D07iptvHZuzuYaeQDMFIU+++TI/-Tmp-//ccoXuPRo.out (No such file or directory)
error: Setup script exited with error: command 'gcc-4.2' failed with exit status 1

最佳答案

我在 ~/.bash_profile 中有这个来解决这个问题:

# Set compile flags to not try to compile for PPC (no longer supported by xcode 4)
# (this is required for eg building pycrypto)
export ARCHFLAGS="-arch i386 -arch x86_64"

关于python - easy_install pycrypto 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6061180/

相关文章:

python - 加密和 Paramiko 问题

python - 为什么小整数缓存似乎不适用于 Python 3 中 round() 函数的 int 对象?

python - 错误: Could not find a version that satisfies the requirement azure-functions

python - 无法使用pycrypto AES加密具有特殊字符的字符串

python - 十六进制字符串到 python 中的 SHA256 摘要

python - 在 Python 中加密数据 -

python - AES 加密中的 IV must be 16 bytes long 错误

python - Python 3.1.1 中的搁置模块

python - 如何将 **kwargs 参数传递给相关的包装函数?

python - 绘制 Pandas OLS 线性回归结果