<p>我正试图安装matplotlib,以便在MacOSX上用Python绘制应用程序。当我运行“Python setup.py install”时,它会给我带来大量错误:<a href="http://pastebin.com/u7fL37ic">http://pastebin.com/u7fL37ic</a>。</p>
<p>一个简短的片段:</p>
<pre><code>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
</code></pre>
<p>我使用MacPorts安装了freetype,我认为这可以解决问题,但没有运气。给了我和以前一样的错误。似乎找不到正确的freetype文件:</p>
<pre><code>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'.
</code></pre>
<p>我应该把freetype文件放在哪里才能找到它们?现在它们在/opt/local/lib中</p>
<p>有什么想法吗?</p>