[英]Import Error - (Python 2.7)
我一直试图解决导入错误,我一整天都在这里,这只会让我发疯。 我真的经历了每个Stack Overflow类似的问题,并尝试了每一个解决方案,似乎没有任何东西可以为我做神奇。
我正在我的终端上运行一个脚本
$ python camelcamelcamel-import.py
我得到的错误是:
Traceback (most recent call last):
File "camelcamelcamel-import.py", line 1, in <module>
import sys, mechanize, lxml.html
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/html/init.py", line 54, in <module>
from .. import etree
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so, 2): Symbol not found: _xsltDocDefaultLoader
Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
Expected in: dynamic lookup
我已经尝试安装/卸载模块,对于pip来说同样的事情,似乎没有什么对我有用。
非常感谢任何帮助,谢谢!
使用brew重新安装libxslt和libxml2。
brew install libxslt libxml2
如果在安装期间看到错误,请执行以下命令:
xcode-select --install
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.