问题
I tried installing lxml on OS X 10.6.8 by:
- Downloading the source from PyPi
sudo python setup.py build --static-deps
sudo python setup.py install
It installed fine, without any errors. And when I go to into the Python REPL I get the following:
Nabs$ python
Python 2.7.2 (v2.7.2:8527427914a2, Jun 11 2011, 14:13:39)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml
>>> import lxml.html
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml-2.3.3-py2.7-macosx-10.3-fat.egg/lxml/html/__init__.py", line 12, in <module>
from lxml import etree
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml-2.3.3-py2.7-macosx-10.3-fat.egg/lxml/etree.so, 2): Symbol not found: _xsltLibxsltVersion
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml-2.3.3-py2.7-macosx-10.3-fat.egg/lxml/etree.so
Expected in: dynamic lookup
来源:https://stackoverflow.com/questions/9501894/importerror-after-install-of-lxml-on-os-x-10-6-8