easy_install pycrypto 的问题

发布于 2024-11-09 04:07:49 字数 1279 浏览 2 评论 0原文

我正在尝试使用 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

I'm trying install pycrypto on osx with easy_install and I'm getting the following error:

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

久伴你 2024-11-16 04:07:49

我的 ~/.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"

I have this in my ~/.bash_profile to address this very issue:

# 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"
梦与时光遇 2024-11-16 04:07:49

是的,这是安装 Xcode 4 的结果。它尝试为 ppc 构建,尽管 Xcode 4 不再具有相关位。请参阅此问题以了解解决方法:https://superuser.com/questions/259278/python-2-6-1-pycrypto-2-3-pypi-package-broken-pipe-during-build

Yes, it's a result of installing Xcode 4. It tries to build for ppc, although Xcode 4 no longer has the relevant bits for that. See this question for ways round it: https://superuser.com/questions/259278/python-2-6-1-pycrypto-2-3-pypi-package-broken-pipe-during-build

佼人 2024-11-16 04:07:49

代码5.1

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pycrypto

xCode 5.1

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip install pycrypto
━╋う一瞬間旳綻放 2024-11-16 04:07:49

看来这对于 OSX 10.9 来说有点困难。这是我所做的额外内容:

brew install libffi

如果您看到有关如何“仅桶”安装的警告,则意味着 homebrew 未链接它,因此您需要提供更多信息使用export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig。此时安装就会失败,因为默认情况下 OSX 现在会因警告标志而终止,因此也请抑制该行为:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

然后您应该能够使用 pip 进行安装。

Looks like this got a little more difficult with OSX 10.9. Here's the additional stuff I did:

brew install libffi

If you see the warning about how it's installed "keg-only", that means homebrew did not link it, so you'll need to provide some more info with export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig. At that point the install blows up because by default OSX now dies on warning flags, so suppress that behavior as well:

export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments

Then you should be able to install with pip.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文