lxml for Python 2.5.6,osx 10.7.3

时间:2013-04-10 16:40:49

标签: python macos lxml

python --version
Python 2.5.6
OS X 10.7.3

我想安装lxml,但无法找到成功的方法 试图

STATIC_DEPS=true pip install lxml
STATIC_DEPS=true pip install --install-option="--libxml2-version=2.7.8" lxml

使用brew等。

我不知道出了什么问题

我的错误:

threads.c: In function 'xmlCleanupThreads':
threads.c:918: error: expected expression before '{' token
make[2]: *** [threads.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
Traceback (most recent call last):
  File "/usr/bin/easy_install-2.7", line 10, in <module>
    load_entry_point('setuptools==0.6c12dev-r85381', 'console_scripts', 'easy_install')()

1 个答案:

答案 0 :(得分:1)

这对我有用:

mkvirtualenv lxml
pip install --no-install --build-dir="./build" lxml
cd build/lxml/
python setup.py build --static-deps --libxml2-version=2.7.8 --libxslt-version=1.1.27
cd -
pip install --no-download --build-dir="./build" lxml

而且:

pip install \
    --install-option="--static-deps" \
    --install-option="--libxml2-version=2.7.8" \
    --install-option="--libxslt-version=1.1.27" \
    lxml

通常我只使用pip install lxml安装,到目前为止没有任何问题。