【问题标题】:not able to upgrade matplotlib to 1.4.3 on ubuntu 14.04无法在 ubuntu 14.04 上将 matplotlib 升级到 1.4.3
【发布时间】:2015-08-17 20:42:32
【问题描述】:

我尝试使用以下命令升级 matplotlib:

$export PYTHONHOME=/usr/lib/python2.7/

$sudo easy_install -U distribute

$sudo pip install --upgrade matplotlib

但它们都没有奏效。下载 matplotlib 1.4.3 包但未安装后显示错误。

任何人都可以帮助正确升级它吗?

【问题讨论】:

  • 欢迎来到 Stack Overflow!请编辑您的问题以包含您获得的完整错误代码的确切引用,因为它通常包含除错误名称之外的更多有用信息。
  • distribute 已死。使用setuptoolspip 安装你的包。
  • 还是不行。请尝试一下,如果您确实找到了解决方案,请告诉我。

标签: python-2.7 matplotlib ubuntu-14.04


【解决方案1】:

你得到的错误说明了这一点。

============================================================================

                    * The following required packages can not be built:

                    * freetype, png

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/snapey/.pip/pip.log

如果你再往上看,它会说

REQUIRED DEPENDENCIES AND EXTENSIONS:

... <Some other packages, all present>

              freetype: no  [The C/C++ header for freetype2 (ft2build.h)

                    could not be found.  You may need to install the

                    development package.]

               png: no  [pkg-config information for 'libpng' could not

                    be found.]

所以,它告诉你问题 - freetypepng 不存在并且无法构建

要纠正这个问题 - 像这样安装它们:

sudo apt-get install libfreetype6-dev libpng12-dev

This is almost a duplicate question,但问题似乎是 Python 3 特定的(不是)。

我发现我必须运行 pip install --upgrade matplotlib 两次,因为它第一次失败并出现有关 python.h 的错误,但后来我有了 matplotlib 1.4.3。在 Ubuntu 14.04 64 位、python 2.7 上测试

顺便说一句 - 这真的很难看,应该用 Ubuntu 和/或 matplotlib 开发人员提出。

【讨论】:

    猜你喜欢
    • 2014-10-29
    • 1970-01-01
    • 1970-01-01
    • 2016-06-26
    • 2015-09-15
    • 2017-06-02
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多