一个简单的
sudo pip install matplotlib --upgrade
失败并显示以下日志:
Downloading/unpacking matplotlib from https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.5.0.tar.gz#md5=7952a539418ed77432aa4727409f24cf
Running setup.py egg_info for package matplotlib
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.0]
python: yes [2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12
2012, 11:14:05) [GCC 4.0.1 (Apple Inc. build
5493)]]
platform: yes [darwin]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.10.1]
dateutil: yes [using dateutil version 2.4.2]
pytz: yes [using pytz version 2015.7]
cycler: yes [cycler was not found. pip will attempt to
install it after matplotlib.]
tornado: yes [using tornado version 2.2]
pyparsing: yes [Your pyparsing contains a bug that will be
monkey-patched by matplotlib. For best results,
upgrade to pyparsing 2.0.1 or later.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype2 (ft2build.h)
could not be found. You may need to install the
development package.]
png: yes [version 1.6.18]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.1.2 / mock is required to
run the matplotlib test suite. "setup.py test" will
automatically download it. Install mock to run
matplotlib.test()]
toolkits_tests: yes [using nose version 1.1.2 / mock is required to
run the matplotlib test suite. "setup.py test" will
automatically download it. Install mock to run
matplotlib.test()]
OPTIONAL BACKEND EXTENSIONS
macosx: yes [installing, darwin]
qt5agg: no [PyQt5 not found]
qt4agg: yes [installing, Qt: 4.7.3, PySide: 1.1.0; PyQt4 not
found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing, version 81008]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: yes [version 9.16]
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.0]
python: yes [2.7.3 |EPD 7.3-2 (64-bit)| (default, Apr 12
2012, 11:14:05) [GCC 4.0.1 (Apple Inc. build
5493)]]
platform: yes [darwin]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.10.1]
dateutil: yes [using dateutil version 2.4.2]
pytz: yes [using pytz version 2015.7]
cycler: yes [cycler was not found. pip will attempt to
install it after matplotlib.]
tornado: yes [using tornado version 2.2]
pyparsing: yes [Your pyparsing contains a bug that will be
monkey-patched by matplotlib. For best results,
upgrade to pyparsing 2.0.1 or later.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: no [The C/C++ header for freetype2 (ft2build.h)
could not be found. You may need to install the
development package.]
png: yes [version 1.6.18]
qhull: yes [pkg-config information for 'qhull' could not be
found. Using local copy.]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [using nose version 1.1.2 / mock is required to
run the matplotlib test suite. "setup.py test" will
automatically download it. Install mock to run
matplotlib.test()]
toolkits_tests: yes [using nose version 1.1.2 / mock is required to
run the matplotlib test suite. "setup.py test" will
automatically download it. Install mock to run
matplotlib.test()]
OPTIONAL BACKEND EXTENSIONS
macosx: yes [installing, darwin]
qt5agg: no [PyQt5 not found]
qt4agg: yes [installing, Qt: 4.7.3, PySide: 1.1.0; PyQt4 not
found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires cairocffi or pycairo to be installed.]
gtkagg: no [Requires pygtk]
tkagg: yes [installing, version 81008]
wxagg: no [requires wxPython]
gtk: no [Requires pygtk]
agg: yes [installing]
cairo: no [cairocffi or pycairo not found]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: no
ghostscript: yes [version 9.16]
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype
----------------------------------------
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build/matplotlib
Storing complete log in /Users/vlad-arisolteanu/.pip/pip.log
同时,
brew install freetype
返回:
Warning: freetype-2.6_1 already installed
看来我的系统上安装了 freetype。那么发生了什么?令人失望的是,像 matplotlib 这样重要的 Python 包没有安装。
如有任何帮助,我们将不胜感激。
最佳答案
由于您使用的是 Enthought,因此安装 matplotlib 等内容的推荐方法是安装 Canopy Express ,它是 Enthought 发行版的免费附加组件,还允许您访问约 100 个可以轻松安装到 Enthought 中的软件包。
您尝试使用 brew
执行的操作不适用于开箱即用的 Enthought,并且需要您设置正确的环境变量和build设置,因为整个系统不支持了解 brew
的存在。
关于python - 由于 freetype,在 OS X 10.11 上将 matplotlib 升级到 1.5 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34268740/