PyPi现在显示matplotlib为1.1.0,所以这个问题得到了解决。通过以下方式安装matplotlib:
pip install matplotlib
PyPi显示matplotlib 1.0.0。但是,当我通过pip将matplotlib安装到virtualenv中时,将安装0.91.1版。
似乎matplotlib's DOAP record on PyPi指向了正确的版本。下面是供参考的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>
从PyPi镜像安装还将安装0.91.1版:
$ pip install -i http://d.pypi.python.org/simple matplotlib
即使matplotlib 1.0.1已经发布,这个问题仍然存在。
我也经历过同样的问题。我不知道为什么会发生这种情况,但我有一个解决方案;使用pip中的-f选项告诉它在哪里可以找到matplotlib源代码。(这也适用于requirements.txt)。
我听从了@oyvindio和@elaichi的建议,但仍然得到0.91.1版本,原因不明。然后编译失败(出现错误
src/mplutils.cpp:17: error: ‘vsprintf’ was not declared in this scope
):直接从git安装matplotlib对我很有用:
发生这种情况的原因是,PyPI上matplotlib 1.0的下载链接指向的URL似乎不是已知格式的文件(URL以/download结尾,而不是文件名)。看这个bug filed on pip。
oyvindio的解决方案是目前我所知道的最好的选择,直到pip在URL上变得更灵活,或者matplotlib修复了它们的PyPI链接。
相关问题 更多 >
编程相关推荐