Matplotlib requirements with pip install in virtualenv
Matplotlib and pip don't seem to play together very well. So I don't think it is possible in this case.
pip
first downloads a package listed in your requirements file and than runs setup.py
, but it doesn't really install it (I'm not quite sure about the internals of pip
). After all packages are prepared in this way, they are installed.
The problem is, that matplotlib
checks if numpy
is installed in its setup.py
(the check itself is defined in setupext.py
). So at the moment the check is performed, numpy
is not installed and the matplotlib setup.py
exits with the error message you received (This may not be a bug, as it may require numpy to build).
This was once addressed in pip issue #24 and issue #25. The issues are closed but give some more details.
What I am doing up to now is to first install numpy and than install all packages from my requirements file.
Update 12/2012
There is a new open pip issue which deals with this problem.
Update 04/2013
The issue is closed as WONTFIX
It's a known problem of the library and it's currently being discussed as a Matplotlib enhancement proposal: https://github.com/matplotlib/matplotlib/wiki/MEP11.Until it's fixed the only solution I can imagine is repackaging the library to remove the numpy check.
Yes. "requirements.txt" is just a flat file from which pip can use to install packages. In that file, you can change the version of the dependencies. For example, it looks like you need at least 1.1, so try changing the line with 'numpy' to be:
numpy==1.1
Or, you can use >= like this:
numpy>=1.1
This may be what's holding you up. But, AFAIK, matplotlib should have a dependency on numpy already. Seems like that may need to be fixed.
See also this How to pip install a package with min and max version range?
and
In setup.py or pip requirements file, how to control order of installing package dependencies?