【问题标题】:pip install matplotlib fails: 'cannot build package freetype; "python setup.py egg_info" failed with error code 1'pip install matplotlib 失败:'无法构建包 freetype; “python setup.py egg_info”失败,错误代码为 1'
【发布时间】:2015-05-08 23:13:58
【问题描述】:

我想使用 matplotlib.pyplot。我不能,因为

altoidnerd@LEPTON:~/ $ pip install matplotlib

在 ubuntu 14 上失败,出现 egg_info 错误,并警告“无法构建包 freetype”

* The following required packages can not be built:

                        * freetype

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-8UvQcW/matplotlib

但是

altoidnerd@LEPTON:~/$ dpkg -L libfreetype6
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/libfreetype.so.6.11.1
/usr/share
/usr/share/doc
/usr/share/doc/libfreetype6
/usr/share/doc/libfreetype6/FTL.TXT.gz
/usr/share/doc/libfreetype6/ft2faq.html
/usr/share/doc/libfreetype6/TODO
/usr/share/doc/libfreetype6/copyright
/usr/share/doc/libfreetype6/changelog.Debian.gz
/usr/share/doc/libfreetype6/pcf
/usr/share/doc/libfreetype6/pcf/README
/usr/lib/x86_64-linux-gnu/libfreetype.so.6

我的 debug.log 在这里:http://pastebin.com/rvDuYDiy

去年github上关于这个的讨论已经结束,但是我无法用它来解决问题(我留了个笔记):

https://github.com/matplotlib/matplotlib/issues/3029

我也开了一个reddit thread

【问题讨论】:

  • 你解决过这个问题吗?我现在有同样的一个,但 ln -s 在最近的操作系统中被禁用到核心目录。

标签: matplotlib pip freetype egg


【解决方案1】:

这对我有用:

sudo apt-get install libfreetype6-dev pkg-config

【讨论】:

    【解决方案2】:

    您上面提到的github thread 中提到的以下命令对我有用:

    sudo ln -s /usr/include/freetype2/ft2build.h /usr/include/

    【讨论】:

      【解决方案3】:

      我有一个类似的问题通过以下方式解决:

      easy_install -U pip
      
      pip install matplotlib
      

      【讨论】:

        猜你喜欢
        • 2019-01-22
        • 2016-06-29
        • 1970-01-01
        • 1970-01-01
        • 2017-11-04
        • 2018-12-03
        相关资源
        最近更新 更多