pip install matplotlib 失败:'无法构建包 freetype; “python setup.py Egg_info”失败,错误代码为 1'

2024-01-02

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

But

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 http://pastebin.com/rvDuYDiy

github上关于这个问题的讨论去年就结束了,但我无法用它来解决问题(我留下了注释):

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

我开始了一个红迪帖子 https://www.reddit.com/r/learnpython/comments/2y89j0/pip_install_fail_command_python_setuppy_egg_info/ too.


这对我来说很有效:

sudo apt-get install libfreetype6-dev pkg-config
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

pip install matplotlib 失败:'无法构建包 freetype; “python setup.py Egg_info”失败,错误代码为 1' 的相关文章

  • 使用每日频率格式化 x 轴

    我正在尝试获取每日数据图 我有 3 个月的数据 每天都很难指出 如何格式化 x 轴 以便我可以获得每个日期 可以使用以下命令更改主要刻度的频率set major locator mdates DayLocator interval 5 如下
  • 如何使用 Misc.imread 将图像分割为红色、绿色和蓝色通道

    我正在尝试将图像切片为 RGB 但在绘制这些图像时遇到问题 我使用此函数从某个文件夹获取所有图像 def get images path image type image list for filename in glob glob pat
  • 多行 x 刻度标签

    我正在尝试制作类似于此 Excel 示例的图 我想知道 x 刻度标签上是否有第二层 例如 5 年统计摘要 我知道我可以使用制作多行刻度标签 n但我希望能够独立地转换这两个级别 这很接近 fig plt figure figsize 8 4
  • 无法为 Python 3.4 创建工作虚拟环境

    I 安装Python 3 4 2 https docs python org 3 using unix html building python和我的 Linux Mint 17 1 中的 Virtualenv 12 0 5 然后我尝试创建
  • 使用 pandas 绘制带有误差线的条形图

    我正在尝试从 DataFrame 生成条形图 如下所示 Pre Post Measure1 0 4 1 9 这些值是我从其他地方计算出来的中值 我还有它们的方差和标准差 以及标准误差 我想将结果绘制为具有适当误差线的条形图 但指定多个误差值
  • matplotlib 后端对渲染格式有什么限制?

    我对 matplotlib 使用的后端在确定可以呈现哪些格式方面所扮演的角色感到困惑 例如 文件说 http matplotlib org faq usage faq html what is a backend agg 后端生成 PNG
  • 如何在 Matplotlib 中编写自己的 LaTeX 序言?

    我正在尝试创建一个数字matplotlib插入我的LaTeX文档 我需要粗体 i and j 没有圆点和帽子的符号 我一直在使用代码 mathbf hat textnormal bfseries i 在我的文档中 但由于这使用了amsmat
  • 在Python中整齐地绘制PMF

    有没有一个库可以帮助我在 python 中整齐地绘制样本的概率质量函数 如下所示 通过matplotlib pyplot的stem模块 matplotlib pyplot stem args kwargs from matplotlib p
  • 根据两个预先计算的直方图报告两个样本的 K-S 统计量

    Problem 在这里 我绘制了存储在文本文件中的 2 个数据集 在列表中 dataset 每个包含 218 亿个数据点 这使得数据太大而无法作为数组保存在内存中 我仍然能够将它们绘制为直方图 但我不确定如何通过2 样本KS测试 http
  • 使用 RGB 数据将输入数据剪切到 imshow 的有效范围(对于浮点数为 [0..1],对于整数为 [0..255])

    我尝试将 MRI 切片转换为 PNG 格式后运行图形切割算法 我不断遇到以下问题 Clipping input data to the valid range for imshow with RGB data 0 1 for floats
  • 为什么 matplotlib 默认不保存整个图形?

    这可能是几乎每个使用 matplotlib 的人都会遇到的问题 如果您生成一个图形 通常包含轴标签和图例 并使用默认设置保存它 您将获得裁剪后的图像 演示代码 import matplotlib pyplot as plt def plot
  • 如何创建Python Egg文件

    我对 Python 中的 Egg 文件有疑问 我有很多按包组织的Python代码 我正在尝试创建egg文件 我正在跟进指示 http peak telecommunity com DevCenter PythonEggs building
  • 从字典中绘制直方图

    我创建了一个dictionary计算 a 中出现的次数list每个键的内容 我现在想绘制其内容的直方图 这是我想要绘制的字典的内容 1 27 34 1 3 72 4 62 5 33 6 36 7 20 8 12 9 9 10 6 11 5
  • pip.main 安装失败,“模块”对象没有属性“main”

    我正在尝试从 python 脚本中安装一些 python 包 并且我正在使用pip main install 为了那个原因 下面是代码片段 try import requests except import pip pip main ins
  • 如何使用 matplotlib 显示文本

    我想这样做 我有这个Python代码 import numpy as np import pylab as plt a np array 1 2 3 4 5 6 7 8 9 10 b np array 7 8 6 3 2 1 5 8 4 1
  • 在 matplotlib 中绘制多边形的并集[重复]

    这个问题在这里已经有答案了 我正在尝试绘制几个多边形的并集matplotlib 具有一定的 alpha 水平 我当前的代码在交叉点处颜色较深 有没有办法让交叉路口与其他地方的颜色相同 import matplotlib pyplot as
  • pip/easy_install 失败:创建进程失败

    关注这篇文章后 如何在 Windows 上安装 pip https stackoverflow com questions 4750806 how to install pip on windows在我使用 Enthought Canopy
  • 如何使用 matplotlib 在误差条图的尖端显示水平线?

    我可以使用下面的代码生成误差条图 代码生成的图表显示了代表错误的垂直线y 我希望在这些错误的尖端有水平线 误差线 但我不知道该怎么做 import numpy as np import matplotlib pyplot as plt x
  • 使用seaborn绘制简单线图

    我正在尝试使用seaborn python 绘制ROC曲线 对于 matplotlib 我只需使用该函数plot plt plot one minus specificity sensitivity bs where one minus s
  • Matplotlib loglog 的错误刻度/标签(双轴)

    我正在使用 matplotlib 创建对数图 如下图所示 默认刻度选择得很糟糕 充其量是这样 右边的 y 轴甚至根本没有 在线性等效中确实如此 而两个 x 轴都只有一个 有没有办法获得合理数量的带有标签的刻度 without为每个情节手动指

随机推荐