gpt4 book ai didi

python - 将 lxml.etree 导入 python 时出现错误

转载 作者:太空狗 更新时间:2023-10-29 21:32:13 26 4
gpt4 key购买 nike

当我像这样输入 python 时,我已经在我的 mac 上安装了一个 lxml

localhost:lxml-3.0.1 apple$ pythonPython 2.7.3 (v2.7.3:70274d53c1dd, Apr  9 2012, 20:52:43) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwinType "help", "copyright", "credits" or "license" for more information.>>> from lxml import etreeTraceback (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

最佳答案

我遇到了同样的问题。如果你已经使用 pip 安装了它,如下所示:pip install lxml

相反,尝试使用

STATIC_DEPS=true pip install lxml

这解决了我的问题。

发现于 this website

关于python - 将 lxml.etree 导入 python 时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13355984/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com