【发布时间】:2014-01-21 04:38:17
【问题描述】:
我想在我有帐户 /myhome 没有 root 权限的服务器上使用 matplotlib。
我下载了 matplotlib 源并尝试使用 distutils 和用户 sheme 安装它,比如 python setup.py install --user,但它返回了以下消息:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.3.1]
python: yes [2.7.3 (default, Jan 2 2013, 13:56:14) [GCC
4.7.2]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.6.2]
dateutil: yes [using dateutil version 1.5]
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.]
png: yes [pkg-config information for 'libpng' could not
be found. Using unknown version.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt4agg: yes [installing, Qt: 4.8.2, PyQt4: 4.9.3]
gtk3agg: yes [installing, version 3.2.4]
gtk3cairo: yes [installing, version 3.2.4]
gtkagg: no [The C/C++ header for gtk (gtk/gtk.h) could not
be found. You may need to install the development
package.]
tkagg: no [TKAgg requires Tkinter.]
wxagg: no [requires wxPython]
gtk: no [The C/C++ header for gtk (gtk/gtk.h) could not
be found. You may need to install the development
package.]
agg: yes [installing]
cairo: yes [installing, version 1.8.8]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: yes [version 1.14]
ghostscript: yes [version 9.05]
latex: yes [version 3.1415926]
pdftops: yes [version 0.18.4]
============================================================================
* The following required packages can not be built:
* freetype
好像缺少'freetype'这个包,所以我下载了它的源码,发现可以通过运行安装到特定的地方:
./configure --prefix=/myhome/somedir
make
make install
我的问题是:我在哪里安装 freetype 以便 distutils 可以检测到它?
我的第一个想法是将它安装在 /myhome/.local 中,因为这是 distutils 在使用 --user 选项时安装模块的地方。
不幸的是,执行此操作时,我仍然收到与上述相同的消息。
我通过使用 virtualenv 包创建虚拟环境尝试了一些更复杂的事情:
virtualenv /myhome/venv/
然后我在myhome/venv/ 中安装了freetype,最后我在这个虚拟环境中运行了distutils,但它又给了我同样的信息。
感谢您的帮助,当然,我不会要求我的系统管理员为我安装 matplotlib。
PS:肯定与我的问题无关,但可能值得注意:我使用 ./configure --prefix=/myhome/somedir --without-png 安装了 freetype 包。如果没有 --without-png 选项,我会收到以下错误:
checking for libpng... configure: error: `libpng-config' not found;
either set the LIBPNG_CFLAGS and LIBPNG_LDFLAGS environment variables,
or pass `--without-png' to the `configure' script.
【问题讨论】:
标签: python matplotlib module installation dependencies