更新2012年10月15日

PYPI现在在1.1.0显示Matplotlib,因此解决了此问题。安装matplotlib通过:

pip install matplotlib

以下过时的信息

PYPI 显示 matplotlib 1.0.0. 。但是,当我通过 pip 进入 Virtualenv, ,安装了0.91.1版。

  • 为什么版本的差异?
  • 有没有办法安装matplotlib 1.0.0?

研究

看起来 Matplotlib在PYPI上的DOAP记录 指向正确的版本。以下是参考的DOAP记录:

<?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>

配置

  • OS:Mac OS X 10.6.6
  • Python 2.7
  • Virtualenv 1.5.1
  • PIP 0.8.1

更新24-上午7:09 AM

从PYPI镜像安装还安装了0.91.1版本:

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

更新2011年1月14日下午4:54

虽然 matplotlib 1.0.1 已经发布了,这个问题仍然存在。

有帮助吗?

解决方案

我遇到了同样的问题。我不知道为什么会发生,但是我确实有修复。使用PIP中的-f选项告诉它在哪里可以找到matplotlib源。 (这也适用于需求。txt)。

pip install -f http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0/matplotlib-1.0.0.tar.gz matplotlib

其他提示

发生这种情况是因为PYPI点上Matplotlib 1.0的下载链接指向URL,该URL似乎不是PIP是已知格式的文件(URL以 /下载而不是文件名结尾)。看到这个 在PIP上提起的错误.

Oyvindio的解决方法是我目前知道的最佳选择,直到PIP对URL变得更加灵活或Matplotlib修复了其PYPI链接。

我遵循 @oyvindio和 @elaichi的建议,但由于某些未知原因,仍在获得0.91.1版。然后这是未能编译的(有错误 src/mplutils.cpp:17: error: ‘vsprintf’ was not declared in this scope):

直接从Git中安装Matplotlib对我有用:

pip install -e git+git@github.com:matplotlib/matplotlib.git#egg=matplotlib

Oyvindio的建议很棒,但是首先,我必须安装一些源代码编译Matplotlib所需的标题(否则它拒绝工作)。在Ubuntu Lucid中,它是这样的:

$ sudo apt-get build-dep python-matplotlib

就在那时,可以安装matplotlib:

pip install -f  http://garr.dl.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz  matplotlib
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top