python - 运行 `pip install` 的 Ubuntu 给出错误 'The follo

在执行 pip install -r requirements.txt 时,在安装 matplotlib 的阶段出现以下错误:

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [not found. pip may install it below.]
              dateutil: yes [dateutil was not found. It is required for date
                        axis support. pip/easy_install may attempt to
                        install it after matplotlib.]
               tornado: yes [tornado was not found. It is required for the
                        WebAgg backend. pip/easy_install may attempt to
                        install it after matplotlib.]
             pyparsing: yes [pyparsing was not found. It is required for
                        mathtext support. pip/easy_install may attempt to
                        install it after matplotlib.]
                 pycxx: yes [Couldn't import.  Using local copy.]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [pkg-config information for 'freetype2' could
                        not be found.]

...

The following required packages can not be built:

                    * freetype

不应该 pip install -r requirements.txt 也安装 freetype 吗?应该如何在 Ubuntu 12.04 中安装 freetype 以便它可以与 matplotlib 一起使用?

最佳答案

没有。 pip 不会安装系统级依赖项。这意味着 pip 不会安装 RPM(Redhat 系统)或 DEB(Debian 系统)。

要安装系统依赖项,您需要根据您的系统使用以下方法之一。

Ubuntu/Debian:

apt-get install libfreetype6-dev

在基于 Ubuntu/Debian 的系统上搜索软件包:

apt-cache search <string>

例如:

apt-cache search freetype | grep dev

Redhat/CentOS/Fedora:

yum -y install freetype-devel

在基于 Redhat/CentOS/Fedora 的系统上搜索软件包:

yum search <string>

例如:

yum search freetype | grep devel

Mac OS X:(通过 Homebrew )

brew install freetype

在基于 Mac OS X 的系统上搜索软件包:

brew search <string>

例如:

brew search freetype

关于python - 运行 `pip install` 的 Ubuntu 给出错误 'The following required packages can not be built: * freetype',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20533426/

相关文章:

linux - fork: retry: 资源暂时不可用

linux - sudo bang bang 到底是什么?

python - 如何在 Python 中使用省略号切片语法?

python - 我可以为 requests.request 设置 max_retries 吗?

python - 我传入的 Django 请求中的 JSON 数据在哪里?

linux - 目录上次修改日期

linux - 什么是英特尔微码?

list - Pythonic方法返回更大列表中每个第n个项目的列表

python - 词法闭包是如何工作的?

python - 如何在 Django 模板中获取我网站的域名?