简体   繁体   中英

can't install lxml (python 2.6.3, osx 10.6 snow leopard)

I try to:

easy_install lxml

and I get this error:

File "build/bdist.macosx-10.3-fat/egg/setuptools/command/build_ext.py", line 85, in get_ext_filename KeyError: 'etree'

any hints?

Due to incompatible changes in the 2.6.3 version of python's distutils, the old easy_install from setuptools no longer works. You need to replace it with easy_install from Distribute . Follow the instructions there, basically:

$ curl -O http://nightly.ziade.org/distribute_setup.py
$ python distribute_setup.py

assuming the 2.6.3 python is first on your $PATH .

EDIT: Besides the option to migrate from setuptools to Distribute, Python 2.6.4, which should be released in a couple of weeks, will contain a workaround in distutils that will unbreak setuptools . Thanks, Tarek, for the fix and thanks, jbastos, for bringing this issue up.

FURTHER EDIT: setuptools itself has been updated (as of 0.6c10 ) to work around the problem with 2.6.3.

Ned :

incompatible changes in the 2.6.3 version of python's distutil

Not precisely. The API hasn't changed but Setuptools overrides them, and makes the assumption they are called in a particular order.

Lennart:

The Distribute installation doesn't seem to trigger the bug

Yes indeed, this precise bug was detected some time ago and fixed in Distribute (and in Ubuntu's setuptools package)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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