26

Update Oct 15, 2012

PyPi is now showing matplotlib at 1.1.0 so this issue is resolved. Install matplotlib via:

pip install matplotlib

Outdated Information Below

PyPi shows matplotlib 1.0.0. However, when I install matplotlib via pip into a virtualenv, version 0.91.1 is installed.

  • Why the difference in versions?
  • Is there a way to pip install matplotlib 1.0.0?

Research

It appears that matplotlib's DOAP record on PyPi is pointing to the correct version. Below is the DOAP record for reference:

<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>matplotlib</name>
<shortdesc>Python plotting package</shortdesc>
<description>matplotlib strives to produce publication quality 2D graphics
      for interactive graphing, scientific publishing, user interface
      development and web application servers targeting multiple user
      interfaces and hardcopy output formats.  There is a 'pylab' mode
      which emulates matlab graphics</description>
<download-page>https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0</download-page>
<homepage rdf:resource="http://matplotlib.sourceforge.net" />
<maintainer><foaf:Person><foaf:name>John D. Hunter</foaf:name>
<foaf:mbox_sha1sum>4b099b4a7f50a1f39642ce59c2053c00d4de6416</foaf:mbox_sha1sum></foaf:Person></maintainer>
<release><Version><revision>1.0.0</revision></Version></release>
</Project></rdf:RDF>

Configuration

  • OS: Mac OS X 10.6.6
  • Python 2.7
  • virtualenv 1.5.1
  • pip 0.8.1

Update 24-Aug-10 7:09 AM

Installing from the PyPi mirror also installs version 0.91.1:

$ pip install -i http://d.pypi.python.org/simple matplotlib

Update January 14, 2011 4:54 PM

Even though matplotlib 1.0.1 has been release, this issue still persists.

Community
  • 1
  • 1
Matthew Rankin
  • 457,139
  • 39
  • 126
  • 163

4 Answers4

18

I've experienced the same problem. I have no idea why it happens, but I do have a fix; use the -f option in pip to tell it where to find the matplotlib sources. (This works in requirements.txt as well).

pip install -f http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0/matplotlib-1.0.0.tar.gz matplotlib
oyvindio
  • 797
  • 5
  • 10
  • I could have sworn that this previously worked for me. Now it installs matplotlib 0.91.1. Not sure what changed, aside from matplotlib releasing a new version. – Matthew Rankin Jan 17 '11 at 15:01
  • This still installs matplotlib 1.0.0 for me with pip 0.8.2. Maybe you should check your pip version? If you want the latest version of matplotlib as of now, replace the download url with http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz. – oyvindio Jan 18 '11 at 09:02
  • Using `pip install -f http://... matplotlib`, I end up with version 0.91.1 installed. (I'm using `matplotlib.__version__` to confirm the version installed. I assume it's not reporting 0.91.1 when in fact 1.0.1 was installed.) I'm running pip 0.8.2 in a environment created with `virtualenv 1.5.1`. I'm wondering if `distribute 0.6.14` is causing the problem. Just guessing at this point. – Matthew Rankin Jan 25 '11 at 17:17
  • Other problem could be that I was using python2.7 in my virtualenv. I've created a new virtualenv with python2.6 now. I'll post an update with the results. – Matthew Rankin Jan 25 '11 at 17:29
  • 1
    The problem was the python2.7 virtualenv. With a python2.6 virtualenv, I can use your `pip install -f http://... matplotlib` and it installs version 1.0.1. The only problem with that is that I get an error when I `pip install scipy` in the python2.6 virtualenv. I'm not real found of trading off between scipy and matplotlib, so I'm going to have to investigate a solution for both. – Matthew Rankin Jan 25 '11 at 18:37
11

This happens because the download link for matplotlib 1.0 on PyPI points to a URL that doesn't appear to pip to be a file in a known format (the URL ends with /download rather than a filename). See this bug filed on pip.

oyvindio's workaround is the best option I'm aware of for now, until either pip gets more flexible about URLs or matplotlib fixes their PyPI link.

Carl Meyer
  • 122,012
  • 20
  • 106
  • 116
8

I followed @oyvindio's and @elaichi's advice, but was still getting version 0.91.1, for some unknown reason. This was then failing to compile (with the error src/mplutils.cpp:17: error: ‘vsprintf’ was not declared in this scope):

Installing matplotlib directly from git worked for me:

pip install -e git+git@github.com:matplotlib/matplotlib.git#egg=matplotlib
edward
  • 2,455
  • 23
  • 12
  • 5
    compared to the response that was chosen, this solution will give you the latest code instead of 1.0.0 – meduz May 04 '11 at 11:15
3

Oyvindio's advice is great but first I had to install some headers needed to source-compile matplotlib (otherwise it refused to work). In Ubuntu Lucid, it goes like this:

$ sudo apt-get build-dep python-matplotlib

And just then it was possible to pip install matplotlib:

pip install -f  http://garr.dl.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz  matplotlib
meduz
  • 3,903
  • 1
  • 28
  • 40
elaichi
  • 508
  • 5
  • 7
  • Thanks for the info. Given you're using apt-get, you must be on a debian derivative. Ubuntu? Mind updating your answer with your configuration? I just updated my question to state that I'm running on Mac OS X. Thanks. – Matthew Rankin Jan 17 '11 at 14:42
  • Thanks. This worked like a charm. I am still on Lucid and just grabbed v1.1.0 like this: pip install -f http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.1.0/matplotlib-1.1.0.tar.gz matplotlib – otterb Feb 21 '12 at 22:05