Matplotlib requirements with pip install in virtualenv

Viewed 11658

I have a requirements.txt file like this:

numpy
matplotlib

When I try pip install -r requirements.txt inside a new virtualvenv, I get this:

REQUIRED DEPENDENCIES

             numpy: no

                    * You must install numpy 1.1 or later to build

                    * matplotlib.

If I install numpy first and matplotlib after, it works. However I'd like to keep using pip install -r requirements.txt. Is it possible?

6 Answers

I've just gotten used to invoking a script to repeatably set up my virtualenv; it involves two requirements file: one with only numpy, and a second one with everything else.

It's not a terrible thing to get used to, since pip will try to do 'all or nothing' when you install via a requirements file. This way, you can stage the installation so dependencies are installed first.

Related