Forums

Matplotlib in Virtualenv installation error

Hi,

I'm testing the possibility to use Django 1.7 and Matplotlib in PythonAnywhere. When trying to install Matplotlib, I get the following error message:

  Could not find any downloads that satisfy the requirement six>=1.4 (from matplotlib)
  Some externally hosted files were ignored (use --allow-external six to allow).

Trying the suggested command still gives the same error:

pip install matplotlib --allow-external six

Any idea if this is caused by a missing six package. It looks like pip packages are downloaded from a PythonAnywhere repository. And also how to fix it ?

There isn't a PythonAnywhere repository. What made you think there was one? All the packages you can install are on PyPI. What version of Python are you using?

OK my mistakes. I suspected that because pip search wasn't working and it sounded like something they could do to save bandwidth. I'm using Python 2.7.6.

Are you sure you've activated your virtualenv when you do the pip install? I tested installing matplotlib on an account that's like a free account and it worked fine.

Looks like I spoke too soon. I actually just got as far as the compilation starting and when it completed I got the same error. It looks like there's a difference between how pip handles getting dependencies and how it handles getting the package you asked for. To work around it, create a file called req.txt with these contents:

argparse==1.2.1
mock==1.0.1
nose==1.3.4
numpy==1.9.1
pyparsing==1.5.6
python-dateutil==2.4.0
pytz==2014.10
six==1.9.0
wsgiref==0.1.2
matplotlib

and run

pip install -r req.txt

in your virtualenv

OK, that worked ! Why ?!!

BIG THANKS by the way.

I'm still trying to work that out. I suspect that it's because matplotlib includes its own version of pip that doesn't play nice with our proxy and the newer version of pip that we use on PythonAnywhere does play nice.