Trying to install pycrypto on Mac OSX mavericks

user1798733 picture user1798733 · Oct 27, 2013 · Viewed 32.1k times · Source

I am currently trying to install pycrypto and when I execute python setup.py build I receive this following error:

cc -bundle -undefined dynamic_lookup -arch x86_64 -arch i386 -Wl,-F. build/temp.macosx-10.9-intel-2.7/src/_fastmath.o -lgmp -o build/lib.macosx-10.9-intel-2.7/Crypto/PublicKey/_fastmath.so
ld: illegal text-relocation to '___gmp_binvert_limb_table' in /usr/local/lib/libgmp.a(mp_minv_tab.o) from '___gmpn_divexact_1' in /usr/local/lib/libgmp.a(dive_1.o) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1

I've already tried reinstalling the command line tools and removing old instances of Xcode.

Any help would be great thanks

Answer

domino picture domino · Mar 15, 2014

This worked for me. (Should work if you are on Xcode 5.1)

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