当 PyPi 显示版本 1.0.0 时,为什么 pip 安装 matplotlib 版本 0.91.1?

发布于 2024-09-15 09:31:15 字数 2400 浏览 2 评论 0 原文

更新于 2012 年 10 月 15 日

PyPi 现在显示 matplotlib 为 1.1.0,因此此问题已解决。通过以下方式安装 matplotlib:

pip install matplotlib

下面过时的信息

PyPi 显示 matplotlib 1.0.0。但是,当我通过 pip 将 matplotlib 安装到 virtualenv,已安装版本 0.91.1。

  • 为什么版本不同?
  • 有没有办法 pip 安装 matplotlib 1.0.0?

研究

看来 PyPi 上的 matplotlib 的 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>

配置

  • 操作系统:Mac OS X 10.6.6
  • Python 2.7
  • virtualenv 1.5.1
  • pip 0.8.1

Update 24-Aug-10 7:09 AM

从 PyPi 镜像安装也会安装版本 0.91.1:

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

Update 2011 年 1 月 14 日下午 4:54

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

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

燕归巢 2024-09-22 09:31:15

我也遇到过同样的问题。我不知道为什么会发生这种情况,但我确实有解决办法;使用 pip 中的 -f 选项告诉它在哪里可以找到 matplotlib 源。 (这也适用于requirements.txt)。

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

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
雨后彩虹 2024-09-22 09:31:15

发生这种情况是因为 PyPI 上 matplotlib 1.0 的下载链接指向的 URL 似乎不是已知格式的文件(该 URL 以 /download 结尾,而不是文件名)。请参阅pip 上提交的错误

oyvindio 的解决方法是我目前所知的最佳选择,直到 pip 对 URL 变得更加灵活或 matplotlib 修复其 PyPI 链接。

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.

倾城泪 2024-09-22 09:31:15

我遵循了 @oyvindio 和 @elaichi 的建议,但由于某种未知的原因,我仍然获得了 0.91.1 版本。然后无法编译(出现错误 src/mplutils.cpp:17: error: 'vsprintf' was not returned in this range):

直接从 git 安装 matplotlib 对我有用:

pip install -e [email protected]:matplotlib/matplotlib.git#egg=matplotlib

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 [email protected]:matplotlib/matplotlib.git#egg=matplotlib
心碎的声音 2024-09-22 09:31:15

Oyvindio 的建议很好,但首先我必须安装一些源编译 matplotlib 所需的标头(否则它无法工作)。在 Ubuntu Lucid 中,它是这样的:

$ sudo apt-get build-dep python-matplotlib

然后就可以 pip 安装 matplotlib:

pip install -f  http://garr.dl.sourceforge.net/project/matplotlib/matplotlib/matplotlib-1.0.1/matplotlib-1.0.1.tar.gz  matplotlib

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文