[英]Error installing matplotlib on OSX
我正在嘗試獲取大熊貓的繪圖功能設置,我正在這樣做:
http://matplotlib.org/faq/installing_faq.html
嘗試安裝時,出現關於未安裝freetype
的錯誤。 但是,它已經安裝:
$ brew install freetype
Warning: freetype-2.6_1 already installed
完整安裝日志
$ easy_install -m matplotlib
Searching for matplotlib
Reading https://pypi.python.org/simple/matplotlib/
Best match: matplotlib 1.5.1
Downloading https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.5.1.tar.gz#md5=f51847d8692cb63df64cd0bd0304fd20
Processing matplotlib-1.5.1.tar.gz
Writing /var/folders/m9/4wkz8drj1dg9pddn916_pdqw0000gn/T/easy_install-XQNDr1/matplotlib-1.5.1/setup.cfg
Running matplotlib-1.5.1/setup.py -q bdist_egg --dist-dir /var/folders/m9/4wkz8drj1dg9pddn916_pdqw0000gn/T/easy_install-XQNDr1/matplotlib-1.5.1/egg-dist-tmp-KGl8Xp
IMPORTANT WARNING:
pkg-config is not installed.
matplotlib may not be able to find some of its dependencies
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.5.1]
python: yes [2.7.10 (default, Oct 23 2015, 18:05:06) [GCC
4.2.1 Compatible Apple LLVM 7.0.0
(clang-700.0.59.5)]]
platform: yes [darwin]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.10.4]
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 [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.]
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.19]
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 [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / mock is
required to run the matplotlib test suite. Please
install it with pip or your preferred tool to run
the test suite]
toolkits_tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite. Please install it with pip or
your preferred tool to run the test suite / mock is
required to run the matplotlib test suite. Please
install it with pip or your preferred tool to run
the test suite]
OPTIONAL BACKEND EXTENSIONS
macosx: yes [installing, darwin]
qt5agg: no [PyQt5 not found]
qt4agg: no [PySide not found; 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: no
latex: no
pdftops: no
OPTIONAL PACKAGE DATA
dlls: no [skipping due to configuration]
============================================================================
* The following required packages can not be built:
* freetype
error: Setup script exited with 1
注意:我嘗試安裝此處列出的development / from-source / header,雖然看起來可以正常工作,但仍不能解決我的問題: http : //mac-dev-env.patrickbougie.com/freetype/
brew install pkg-config
應該可以幫助matplotlib找到要編譯的依賴項。
或者,使用新版本的pip
而不是easy_install
將在osx中下載二進制車輪軟件包,這更容易並且不需要依賴項。
即pip install matplotlib
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.