【发布时间】:2013-04-10 17:21:58
【问题描述】:
我是一个 Python 新手,在 Mac OS X 10.7 上安装 Scrapy 时遇到问题。我尝试了很多不同的东西,但总而言之,当我运行时:
scrapy startproject tutorial
我遇到了这些错误:
ImportError: dlopen(/Library/Python/2.7/site-packages/lxml/etree.so, 2): Symbol not found: ___xmlStructuredErrorContext
Referenced from: /Library/Python/2.7/site-packages/lxml/etree.so
Expected in: flat namespace
in /Library/Python/2.7/site-packages/lxml/etree.so
经过大量谷歌搜索,我关注了this post 并尝试了:
python setup.py build --static-deps --libxml2-version=2.7.8 && pip install lxml
但它告诉我:
RuntimeError: ERROR: Trying to build without Cython, but pre-generated 'src/lxml/lxml.etree.c' is not available (pass --without-cython to ignore this error).
如果我使用 —without-cython 选项运行相同的命令,我会得到:
error: command 'llvm-gcc-4.2' failed with exit status 1
(虽然我已经安装了 XCode 命令行工具)
提前感谢您的帮助!
(仅供参考,我正在使用 MacPorts 和 pip install...)
【问题讨论】:
标签: macos installation lxml scrapy