简体   繁体   English

在OS X 10.6上安装lxml时ImportError

[英]ImportError while installing lxml on OS X 10.6

I am trying to install lxml on OS X 10.6 using Python 2.7a3. 我正在尝试使用Python 2.7a3在OS X 10.6上安装lxml。 However I am receiving an error during the install setup: ImportError: cannot import name _config_vars 但是,我在安装安装过程中收到错误:ImportError:无法导入名称_config_vars

I have put the terminal output here . 我把终端输出放在这里了

Thanks. 谢谢。

If you've had a 10.7 , I'd ask "have you latest X-Code installed?", because I got no errors just now. 如果您使用的是10.7 ,我会问“您是否安装了最新的X-Code ?”,因为我现在没有错误。
But instead I will ask: did you try/consider easy_install or pip install ? 但是我会问:您是否尝试过/考虑使用easy_installpip install

You're using an alpha release of Python 2.7.0, an alpha release for which setuptools , which is used by lxml's setup.py , doesn't work. 您正在使用的是Python 2.7.0的Alpha版本,该Alpha版本setuptools使用lxml的setup.py使用的setuptools Setuptools relies on an implementation detail of distutils.sysconfig (the _config_vars attribute) that was changed in the early Python 2.7 alpha releases, and reverted later in the release process (to un-break setuptools, in all likelyhood.) Setuptools依赖于distutils.sysconfig_config_vars属性)的实现细节,该实现细节在早期的Python 2.7 alpha发行版中已更改,并在发行过程的稍后阶段恢复(很可能恢复为不间断的setuptools)。

It's a good idea to install alpha releases to test if your own software works in the newer Python version, but you should not keep using them after newer versions are released, and certainly not after the final release has been made. 安装alpha版本以测试您自己的软件是否可以在较新的Python版本中运行是个好主意,但您不应在新版本发布后继续使用它们,当然也不能在最终版本发布后继续使用它们。 In this case, two more patchreleases were made later; 在这种情况下,稍后又发布了两个补丁版本。 you should really install those instead. 您应该真正安装它们。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM