在 Mac OS X 上使用 pip 安装 pycrypto 时出现 Broken Pipe 错误
我正在尝试通过 pip 在 OS X 上安装 pycrypto(版本 2.3)。当编译器尝试编译 MD2.c 时,我收到“Broken pipeline”错误。使用 easy_install 时我遇到了非常类似的错误。
这是我收到的错误:
bash-3.2$
bash-3.2$ sudo pip install pycrypto
Password:
Downloading/unpacking pycrypto
Running setup.py egg_info for package pycrypto
Installing collected packages: pycrypto
Running setup.py install for pycrypto
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/MD2.c -o build/temp.macosx-10.6-universal-2.6/src/MD2.o
/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/tmp//cc47qHNI.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/Users/damusin/tmp/pycrypto/pycrypto-2.3/build/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-W6xQ61-record/install-record.txt:
running install
running build
running build_py
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/MD2.c -o build/temp.macosx-10.6-universal-2.6/src/MD2.o
/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/tmp//cc47qHNI.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/Users/damusin/tmp/pycrypto/pycrypto-2.3/build/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-W6xQ61-record/install-record.txt failed with error code 1
Storing complete log in /Users/admin/.pip/pip.log
bash-3.2$
bash-3.2$
我尝试使用 mac ports 并使用命令“sudo port install py26-crypto”来安装此软件包,看起来安装顺利,但随后它告诉我运行命令时缺少 pycrypto 软件包“fab”(织物)。
我尝试使用 YH Wong 在这里回答中推荐的“ARCHFLAGS”命令,但没有运气: https://superuser. com/questions/259278/python-2-6-1-pycrypto-2-3-pypi-package-broken-pipe-during-build
我正在使用 Mac OS X 10.6.7 和 python 2.6.6 和 XCode 已安装。
I am attempting to install pycrypto (version 2.3) on OS X via pip. I am getting a "Broken pipe" error when the compiler attempts to compile MD2.c. I get a very similar error when using easy_install.
Here is the error that I am getting:
bash-3.2$
bash-3.2$ sudo pip install pycrypto
Password:
Downloading/unpacking pycrypto
Running setup.py egg_info for package pycrypto
Installing collected packages: pycrypto
Running setup.py install for pycrypto
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/MD2.c -o build/temp.macosx-10.6-universal-2.6/src/MD2.o
/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/tmp//cc47qHNI.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
Complete output from command /usr/bin/python -c "import setuptools;__file__='/Users/damusin/tmp/pycrypto/pycrypto-2.3/build/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-W6xQ61-record/install-record.txt:
running install
running build
running build_py
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.
building 'Crypto.Hash.MD2' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -fwrapv -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -std=c99 -O3 -fomit-frame-pointer -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c src/MD2.c -o build/temp.macosx-10.6-universal-2.6/src/MD2.o
/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/tmp//cc47qHNI.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
----------------------------------------
Command /usr/bin/python -c "import setuptools;__file__='/Users/damusin/tmp/pycrypto/pycrypto-2.3/build/pycrypto/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --single-version-externally-managed --record /tmp/pip-W6xQ61-record/install-record.txt failed with error code 1
Storing complete log in /Users/admin/.pip/pip.log
bash-3.2$
bash-3.2$
I attempted to install this package using mac ports with the command "sudo port install py26-crypto", and looks to install smoothly but then it tells me that the pycrypto package is missing when running the command "fab" (Fabric).
I attempted using the "ARCHFLAGS" command recommended in answer by YH Wong here but no luck:
https://superuser.com/questions/259278/python-2-6-1-pycrypto-2-3-pypi-package-broken-pipe-during-build
I am using Mac OS X 10.6.7 with python 2.6.6 and XCode is installed.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您已安装 Xcode 4,请尝试在调用
pip
或easy_install
之前设置ARCHFLAGS
:问题是 Xcode 4 已删除对
的支持-arch ppc
但 Mac OS X 10.6 上的系统 Python 2.6 期望构建具有所有三种架构的通用 C 扩展模块。如果您在 sudo 命令之前定义环境变量,则它可能不会导出到 sudo 环境。If you have installed Xcode 4, try setting
ARCHFLAGS
before callingpip
oreasy_install
:The problem is that Xcode 4 has removed support for
-arch ppc
but the system Python 2.6 on Mac OS X 10.6 expects to build universal C extension modules with all three architectures. And if you define the environment variable prior to the sudo command, it will likely not be exported through to the sudo environment.Xcode 5.1
Xcode 5.1