matplotlib - pip安装matplotlib失败: 'cannot build package freetype; “python setup.py egg_info” failed with error code 1'

标签 matplotlib pip freetype egg

我想使用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

最佳答案

这帮了我大忙:

sudo apt-get install libfreetype6-dev pkg-config

关于matplotlib - pip安装matplotlib失败: 'cannot build package freetype; “python setup.py egg_info” failed with error code 1',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28914202/

相关文章:

Python 条形图和折线图,在一张图中包含组

python - 如何修复尝试安装 Tensorflow 导致的异常?

python - 在 Matplotlib 中删除楔形极坐标图周围的空间

python - 如何在堆叠直方图中排列箱,Python

python - 如何将自定义 CA Root 证书添加到 Windows 中 pip 使用的 CA Store?

python - Python(pip)未在kubernetes上安装ElasticSearch库

FreeType - 帮助我理解字形的 Advance.y 属性

java - libgdx-freetype 如何以正确的字母间距缩放字体?

python - 删除 matplotlib 中 x 轴共享图中的冗余代码