Why does pip install matplotlib version 0.91.1 when PyPi shows version 1.0.0?

不问归期 提交于 2019-11-28 18:41:16

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

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.

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
elaichi

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
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!