问题描述
我正在尝试安装matplotlib以便在Mac OS X上的Python中绘制应用程序的图形.当我运行"python setup.py install"时,它给了我这样的错误负载:.
I'm trying to install matplotlib for graphing applications in Python on Mac OS X. When I run "python setup.py install", it gives me this load of errors: http://pastebin.com/u7fL37ic.
快速摘要:
src/ft2font.cpp:2170: error: ‘FT_LOAD_TARGET_MONO’ was not declared in this scope
src/ft2font.cpp:2171: error: ‘FT_LOAD_TARGET_LCD’ was not declared in this scope
src/ft2font.cpp:2172: error: ‘FT_LOAD_TARGET_LCD_V’ was not declared in this scope
src/ft2font.cpp:2175: error: ‘_ft2Library’ was not declared in this scope
src/ft2font.cpp:2175: error: ‘FT_Init_FreeType’ was not declared in this scope
src/ft2font.cpp: In destructor ‘virtual ft2font_module::~ft2font_module()’:
src/ft2font.cpp:2186: error: ‘_ft2Library’ was not declared in this scope
src/ft2font.cpp:2186: error: ‘FT_Done_FreeType’ was not declared in this scope
lipo: can't figure out the architecture type of: /var/folders/Nj/Njnlp9qSF64sMESWcaDnk++++TI/-Tmp-//cchyYmM5.out
error: command 'gcc-4.0' failed with exit status 1
我使用MacPorts安装了freetype,我认为这可以解决问题,但是没有运气.给我和以前一样的错误.似乎找不到正确的freetype文件:
I installed freetype using MacPorts, and I thought that would fix the issue, but no luck. Gives me same error as before. It looks like it can't find the right freetype files:
BUILDING MATPLOTLIB
matplotlib: 1.0.0
python: 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) [GCC
4.0.1 (Apple Inc. build 5493)]
platform: darwin
REQUIRED DEPENDENCIES
numpy: 1.5.0
freetype2: found, but unknown version (no pkg-config)
* WARNING: Could not find 'freetype2' headers in any
* of '.', './freetype2'.
我应该将freetype文件放在哪里,以便可以找到它们?现在他们在/opt/local/lib
Where should I put the freetype files so that they can be found? Right now they're in /opt/local/lib
有什么想法吗?
推荐答案
您还可以考虑使用Enthought发行版(非商业用途甚至免费提供)它完全安装,没有任何困难 http://www.enthought.com/products/getepd.php (我与Enthought无关,我只是一个满意的用户)
you may also consider using the Enthought distribution (which comes even free for non-commercial usage)It comes fully installed without any difficultyhttp://www.enthought.com/products/getepd.php(I have no relationship with Enthought whatsoever - I'm just a satisfied user)
这篇关于无法在Mac OS X上安装matplotlib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!