Search code examples
gccpipeggpycrypto

How to use pip install where one requirement has dependency on version on gcc-4.5


I am installing an egg packaged for pip, inside my virtualenv, under Python 2.7.2. The egg has 16 requirements, one of which (pycryptopp 0.5.29) is known to fail with gcc-4.6 and hence must be compiled with 4.5. The system has both gcc-4.6 (default) and gcc-4.5 installed.

How do I configure/hack pip install to build this package specially? (or do I just temporarily kludge the link /usr/bin/gcc while installing this package)

Do I need to clean up the existing (virtualenv)/build directory where it broke, and if so how?

(I already read the pip documentation and searched SO + SU)


Solution

  • No need to fiddle around with symlinks here. On most Linux systems you can set the compiler to use with the CC env var. In case of pycryptopp and pip the following might help:

    $ CC=/usr/bin/gcc-4.5 pip install pycryptopp
    

    given that you have GCC 4.5 installed in that location. This worked fine for me on Ubuntu 11.10 (oneiric) with packages gcc-4.5 and g++-4.5 installed.