Problems with easy_install pycrypto

I try to install pycrypto on osx with easy_install and I get 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 
+6
source share
4 answers

Yes, this is the result of installing Xcode 4. It is trying to build for ppc, although Xcode 4 no longer has the corresponding bits for this. See this question for paths around it: https://superuser.com/questions/259278/python-2-6-1-pycrypto-2-3-pypi-package-broken-pipe-during-build

+2
source

I have this in my ~/.bash_profile to solve this very problem:

 # 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" 
+10
source

xcode 5.1

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

It seems like OSX 10.9 is a bit more complicated. Here is some additional material that I made:

brew install libffi

If you see a warning about how he installed "only keg", it means that the homebrew did not bind it, so you need to provide additional information using export PKG_CONFIG_PATH=/usr/local/opt/libffi/lib/pkgconfig . At this point, the installation explodes because by default OSX now dies from warning flags, so suppress this behavior as well:

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

Then you can install using pip .

0
source

Source: https://habr.com/ru/post/888555/


All Articles