运行`pip install`的Ubuntu给出错误“无法构建以下必需的包:* freetype" [英] Ubuntu running `pip install` gives error 'The following required packages can not be built: * freetype'
问题描述
在执行 pip install -r requirements.txt
时,我在安装 matplotlib
的阶段收到以下错误:
When performing pip install -r requirements.txt
, I get the following error during the stage where it is installing 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
一起使用?
Shouldn't pip install -r requirements.txt
also install freetype? How should freetype be installed in Ubuntu 12.04 so it works with matplotlib
?
推荐答案
没有.pip
不会安装系统级依赖项.这意味着 pip
不会安装 RPM(s)(基于 Redhat 的系统)或 DEB(s)(基于 Debian 的系统).
No. pip
will not install system-level dependencies. This means pip
will not install RPM(s) (Redhat based systems) or DEB(s) (Debian based systems).
要安装系统依赖项,您需要根据您的系统使用以下方法之一.
To install system dependencies you will need to use one of the following methods depending on your system.
Ubuntu/Debian:
apt-get install libfreetype6-dev
在基于 Ubuntu/Debian 的系统上搜索软件包:
To search for packages on Ubuntu/Debian based systems:
apt-cache search <string>
例如:
apt-cache search freetype | grep dev
<小时>
Redhat/CentOS/Fedora:
yum -y install freetype-devel
在基于 Redhat/CentOS/Fedora 的系统上搜索软件包:
To search for packages on Redhat/CentOS/Fedora based systems:
yum search <string>
例如:
yum search freetype | grep devel
<小时>
Mac OS X:(通过 Homebrew)>
brew install freetype
要在基于 Mac OS X 的系统上搜索软件包:
To search for packages on Mac OS X based systems:
brew search <string>
例如:
brew search freetype
这篇关于运行`pip install`的Ubuntu给出错误“无法构建以下必需的包:* freetype"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!