<p>谢谢上面的链接。我可以让matplotlib做一些小改动。我正在记录我遇到的特定错误消息,以备将来参考。</p>
<p>环境:
MacOSX10.7.4(Lion)运行股票Python2.7.1(见/usr/bin)</p>
<p>我开始尝试让matplotlib在默认安装下工作。setup.py特别指出了一些问题:</p>
<pre><code>freetype2: found, but unknown version (no pkg-config)
* WARNING: Could not find 'freetype2' headers in any
* of '.', './freetype2'.
</code></pre>
<p>以及</p>
<pre><code>OPTIONAL BACKEND DEPENDENCIES
libpng: found, but unknown version (no pkg-config)
* Could not find 'libpng' headers in any of '.'
</code></pre>
<p>安装步骤将失败,并显示以下错误消息:</p>
<pre><code>/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include/numpy/__multiarray_api.h:1187: warning: ‘int _import_array()’ defined but not used
lipo: can't open input file: /var/tmp//ccG28dDI.out (No such file or directory)
</code></pre>
<p>搜索这个文件没有任何帮助。我仔细研究了一下,认为我不值得花时间沿着virtualenv路线走下去。</p>
<p>我最终遵循了上面jholewinski链接中概述的步骤。在/usr/local/中安装了一个新的Python2.7.4,并按照那里的说明操作。(我重新安装了pkg config)。
我可以从git中提取最新版本的matplotlib,它运行得很好。</p>
<p>libpng(1.5.4)和freetype2(13.2.7)库这次都出现了。</p>