擅长:python、mysql、java
<p>您已经安装了新版本的Python(2.7.2),但还需要安装并使用<code>easy_install</code>(来自<a href="http://pypi.python.org/pypi/distribute" rel="nofollow">^{<cd2>}</a>或<code>setuptools</code>)的副本来使用它。最终,您使用了与Apple提供的Python2.6相关联的默认Apple提供的<code>easy_install</code>版本。注意<code>easy_install</code>输出中的<code>/Library/Python/2.6</code>。(您可以在使用<code>/usr/bin/python2.6</code>时尝试导入<code>lxml</code>)在使用Python 2.7安装<code>easy_install</code>之后,如果使用标准Python.org安装程序默认值,那么新的<code>easy_install</code>应该首先位于shell路径上。如果没有,请更新您的<code>PATH</code>:</p>
<pre><code>export PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
</code></pre>
<p>然后<code>easy_install lxml</code>使用它。对于python.org 2.7.2,您不需要添加<code>ARCHFLAGS</code>环境变量,但它不会造成伤害。</p>