【发布时间】:2010-03-03 00:31:19
【问题描述】:
我已经认识到 ElementTree 不会做我希望它做的事情。我已经查看了 lxml 的文档,看来它可以满足我的目的。要获得 lxml,我需要获得 easy_install。于是我从here下载了,放到/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/。然后我去了那个文件夹,然后运行sh setuptools-0.6c11-py2.6.egg。
安装成功。然后我很兴奋,因为我认为 easy_install 的全部意义在于我可以通过 easy_install lxml 进行安装,lxml 会神奇地被下载、构建和正确安装,为我的导入乐趣做好准备。所以我跑了easy_install lxml。我在下面粘贴了结果。我该怎么办?
easy_install lxml
Searching for lxml
Reading http://pypi.python.org/simple/lxml/
Reading http://codespeak.net/lxml
Best match: lxml 2.2.6
Downloading http://codespeak.net/lxml/lxml-2.2.6.tgz
Processing lxml-2.2.6.tgz
Running lxml-2.2.6/setup.py -q bdist_egg --dist-dir /var/folders/49/49N0+g5QFKCm51AbzMtghE+++TI/-Tmp-/easy_install-rxbP6K/lxml-2.2.6/egg-dist-tmp-fjakR0
Building lxml version 2.2.6.
NOTE: Trying to build without Cython, pre-generated 'src/lxml/lxml.etree.c' needs to be available.
Using build configuration of libxslt 1.1.12
Building against libxml2/libxslt in the following directory: /usr/lib
unable to execute gcc-4.0: No such file or directory
error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1
【问题讨论】:
-
(re: 你的代码编辑器的问题)缩进四个空格来组成一个代码块,或者在你有一些突出显示的东西时点击编辑器中的“01010”按钮。
标签: python lxml easy-install