[英]Broken Pipe error when using pip to install pycrypto on Mac OS X
我試圖通過pip在OS X上安裝pycrypto(版本2.3)。 當編譯器嘗試編譯MD2.c時,我收到“Broken pipe”錯誤。 使用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$
我嘗試使用帶有命令“sudo port install py26-crypto”的mac端口安裝此軟件包,並且看起來順利安裝但是它告訴我在運行命令“fab”(Fabric)時缺少pycrypto軟件包。
我嘗試使用YH Wong在這里推薦的“ARCHFLAGS”命令,但沒有運氣: https ://superuser.com/questions/259278/python-2-6-1-pycrypto-2-3-pypi-package-broken -pipe-期間建造
我正在使用帶有python 2.6.6的Mac OS X 10.6.7並安裝了XCode。
如果您已經安裝了Xcode 4, ARCHFLAGS
在調用pip
或easy_install
之前嘗試設置ARCHFLAGS
:
sudo bash
export ARCHFLAGS='-arch i386 -arch x86_64'
pip ...
問題是Xcode 4已經刪除了對-arch ppc
支持,但Mac OS X 10.6上的系統Python 2.6期望構建具有所有三種體系結構的通用C擴展模塊。 如果在sudo命令之前定義環境變量,則可能無法將其導出到sudo環境。
Xcode 5.1
ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future pip2.7 install pycrypto
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.