我已經安裝在我的Mac的LXML,當我在Python這樣出現錯誤時,進口lxml.etree到Python
localhost:lxml-3.0.1 apple$ python Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from lxml import etree Traceback (most recent call last): File "", line 1, in ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml-3.0.1-py2.7-macosx-10.6-intel.egg/lxml/etree.so, 2): Symbol not found: ___xmlStructuredErrorContext Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml-3.0.1-py2.7-macosx-10.6-intel.egg/lxml/etree.so Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml-3.0.1-py2.7-macosx-10.6-intel.egg/lxml/etree.so
本文可能幫助:[在Mac OS X 10.7上的Virtualenv中構建Python Lxml](http://roderickhodgson.com/blog/2012/10/27/building-python-lxml-on-mac-os- x-10-dot-7 /)(你可能會鏈接到_libxml2_的舊版本,而不是_lxml_所需的版本)。 –
我會考慮Virtualenv,但我可以在當前的Python安裝lxml基礎? – heghogbbb
謝謝,我將在對此解決方案進行測試後返回此處 – heghogbbb