tags:

views:

1025

answers:

4

I'm trying to install pycrypto-2.1.0 but attempt to do with 'python setup.py build' elicits:

running build
running build_py
running build_ext
warning: GMP library not found; Not building Crypto.PublicKey._fastmath.

I installed GMP (gmp-4.3.2) and it's in: /usr/local/lib

How do I get python/pycrypto to recognize that GMP is already present on my system?

Mac OS: 10.6.3 Python version: 2.6.1

+1  A: 

Looking at setup.py for pycrypto, it only searches for GMP in /lib and /usr/lib. To fix this, either change setup.py to also search /usr/local/lib by adding it to the list on line 155 (recommended), or reinstall GMP into /lib or /usr/lib (not recommended but would work).

You may also need to add self.__add_compiler_option('-I/usr/local/include'); self.__add_compiler_option('-L/usr/local/lib') in order for the compiler to find the proper include files and static libraries if it doesn't include those paths by default.

Adam Rosenfield
+2  A: 
sudo ln -s /usr/local/lib/libgmp.dylib /usr/lib/libgmp.dylib
Alex Reynolds
A: 

Mmm, you should put more log lines. I had that error, but my problem was that I didn't install the python-dev package in my Ubuntu Karmic.

Elsurexiste
+1  A: 

I have the same problem but libgmp located in /usr/lib, and /usr/local/lib is empty. Problem solved by installing gmp-devel and python-devel packages.

Vaychick