Freezing Pin, NumPy, and SciPy Requirements on OS X

I have a requirements requirements file that I use with virtualenv to automatically capture dependencies for my application.

The application depends on both NumPy and SciPy, and as such, the requirements file for my applications includes:

numpy==1.5.0 scipy==0.8.0 

However, when you run this pip in a new virtualenv, the installation fails with the following error:

 File "/Users/x/virtualenv/deploy/src/scipy/setup.py", line 58, in svn_version from numpy.compat import asstr ImportError: No module named numpy.compat Complete output from command python setup.py egg_info: Traceback (most recent call last): 

This is because SciPy requires installing NumPy before it is built. Therefore, if I remove SciPy and then manually add SciPy (pip install scipy), it will work.

How can I solve this problem, given that pip is not installed in any particular order?

+4
source share
2 answers

I do not think you can. Pip and setuptools are not standard tools - we try to support them on a voluntary basis, but they are fragile. In particular, since scipy setup.py requires numpy to run, it cannot work using the install_requires argument.

+4
source

I faced the same problem! Fortunately, the latest version of pip installs packages in the same order as they are listed in the requirements file.

I updated this command (it needs Mercurial , since pip is hosted on Bitbucket ):

 pip install hg+https://bitbucket.org/ianb/pip 
+1
source

All Articles