bash-3.2$ pip install lxml-2.3.5.tgz Unpacking ./lxml-2.3.5.tgz Running setup.py egg_info for package from file:///Users/apple/workspace/pythonhome/misc/lxml-2.3.5.tgz Building lxml version 2.3.5. Building with Cython 0.17. Using build configuration of libxslt 1.1.27 Building against libxml2/libxslt in the following directory: /usr/local/lib warning: no previously-included files found matching '*.py' Installing collected packages: lxml Running setup.py install for lxml Building lxml version 2.3.5. Building with Cython 0.17. Using build configuration of libxslt 1.1.27 Building against libxml2/libxslt in the following directory: /usr/local/lib skipping 'src/lxml/lxml.etree.c' Cython extension (up-to-date) building 'lxml.etree' extension llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/usr/local/include -I/usr/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace llvm-gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -L/usr/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.6-intel-2.7/lxml/etree.so skipping 'src/lxml/lxml.objectify.c' Cython extension (up-to-date) building 'lxml.objectify' extension llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/usr/local/include -I/usr/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.objectify.o -w -flat_namespace llvm-gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.objectify.o -L/usr/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.6-intel-2.7/lxml/objectify.so Successfully installed lxml Cleaning up... bash-3.2$ 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. >>> import lxml >>> import html Traceback (most recent call last): File "", line 1, in ImportError: No module named html >>> from lxml import html Traceback (most recent call last): File "", line 1, in File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/html/__init__.py", line 12, in from lxml import etree ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so, 2): Symbol not found: _exsltDateXpathCtxtRegister Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
旧版本lxml2.3.4再次出现相同错误
bash-3.2$ pip install lxml-2.3.4.tgz Unpacking ./lxml-2.3.4.tgz Running setup.py egg_info for package from file:///Users/apple/workspace/pythonhome/misc/lxml-2.3.4.tgz Building lxml version 2.3.4. Building with Cython 0.17. Using build configuration of libxslt 1.1.27 Building against libxml2/libxslt in the following directory: /usr/local/lib warning: no previously-included files found matching '*.py' Installing collected packages: lxml Running setup.py install for lxml Building lxml version 2.3.4. Building with Cython 0.17. Using build configuration of libxslt 1.1.27 Building against libxml2/libxslt in the following directory: /usr/local/lib skipping 'src/lxml/lxml.etree.c' Cython extension (up-to-date) building 'lxml.etree' extension llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/usr/local/include -I/usr/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.etree.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -w -flat_namespace llvm-gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.etree.o -L/usr/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.6-intel-2.7/lxml/etree.so skipping 'src/lxml/lxml.objectify.c' Cython extension (up-to-date) building 'lxml.objectify' extension llvm-gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -I/usr/local/include -I/usr/local/include/libxml2 -I/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/lxml/lxml.objectify.c -o build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.objectify.o -w -flat_namespace llvm-gcc-4.2 -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-2.7/src/lxml/lxml.objectify.o -L/usr/local/lib -lxslt -lexslt -lxml2 -lz -lm -o build/lib.macosx-10.6-intel-2.7/lxml/objectify.so Successfully installed lxml Cleaning up... bash-3.2$ 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. >>> import os >>> import lxml >>> 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/etree.so, 2): Symbol not found: _exsltDateXpathCtxtRegister Referenced from: /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so Expected in: flat namespace in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
嘿,我已经尝试使用康达环境,它的工作。默认的venv似乎在M1芯片上工作得很糟糕。
您必须通过以下方式安装:
conda install -c conda-forge requests-html
另请参阅将 lxml.etree 导入 python 时出现错误
我认为这里的关键错误是:
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so, 2): Symbol not found: _exsltDateXpathCtxtRegister
我在lxml开发列表中发现了另一个有同样问题的人。
他们的建议是:
您可能需要检查您的 libxml/libxslt 库。确保您具有 lxml 安装说明中所需的版本
从跑步开始
ldd /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/lxml/etree.so
这将显示您是否有任何未解析的共享库。您可能需要安装/更新某些软件包。
有关更多疑难解答提示,请查看上面链接的线程。
问题内容: 我在Windows 10计算机上,最近从python 2.7移至3.5。尝试通过pip安装lxml时,它将停止并抛出此错误消息- 生成“ lxml.etree”扩展 错误:需要Microsoft Visual C ++ 14.0。使用“ Microsoft Visual C ++生成工具”获得它: http //landinghub.visualstudio.com/visual-cp
我在一台windows 10机器上,最近从python 2.7迁移到了3.5。当尝试通过pip安装lxml时,它会停止并抛出此错误消息- 正在构建lxml。etree'扩展名 错误:需要Microsoft Visual C 14.0。使用“Microsoft Visual C Build Tools”获取:http://landinghub.visualstudio.com/visual-cpp-
问题内容: 我正在使用Mac OS X Yosemite版本10.10.3。 我在http://johnlaudun.org/20150512-installing-and-setting-pip-with- macports/中 使用macport安装了python2.7和pip 我可以成功安装软件包并将其导入我的python环境和python脚本中。但是,找不到与可以从终端中的命令行调用的软件
在Mac OS 10.14.6,我试图安装lxml的Python 3.6与: 我得到一个例外: 这是我得到的全部痕迹: 搜索lxml阅读https://pypi.python.org/simple/lxml/下载https://files.pythonhosted.org/packages/03/a8/73d795778143be51d8b86750b371b3efcd7139987f71618a
问题内容: 尝试在Ubuntu 12.10 x64中的virtualenv中运行“ pip install lxml”时出现以下错误。我有Python 2.7。 我在这里看到了关于同一问题的其他相关问题,并尝试安装python-dev,libxml2-dev和libxslt1-dev。 从我提示命令的那一刻到错误发生的那一刻,请仔细查看一下追溯。 问题答案: 这是我保存的笔记。 它适用于我的Ubu
问题内容: 尝试通过pip安装lxml时出现错误。 我找不到要通过pip安装的任何libxml2 dev软件包。 在Windows 10下的virtualenv中的x86上使用Python 2.7和Python3.x。 问题答案: 从http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml安装适用于您的python版本的lxml 。这是带有所需模块/依赖项的预
Sonarqube版本-7.9.5 SonarQube扫描仪-sonar-scanner-msbuild-5.0.4.24009-net46 源代码包含-C#、Angular.js、html5、JavaScript。 msbuild.exe/t:重新生成 sonarscanner.msbuild.exe结束/d:sonar.login=“tokenid_abc” 错误:SonarScanner执行