问题描述
>>> import lxml
>>> from lxml import etree
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python3.4/site-packages/lxml/etree.cpython-34m.so: undefined symbol: __xmlStructuredErrorContext
我确实有libxml2和libxslt,我也尝试过卸载和重新安装,但没有帮助.lxml版本:3.4.4,python:3.4.2,作业系统:RHEL 5.5请帮助解决此问题
i do have libxml2 and libxslt, i have tried uninstalling and reinstalling too, it didn't help.lxml version: 3.4.4,python: 3.4.2,OS: RHEL 5.5Please help resolve this issue
谢谢
推荐答案
您的lxml.etree
版本是针对与实际安装的版本不同的libxml2
版本编译的.重新安装libxml2并没有帮助,因为您只是重新安装了相同的代码.重新安装捆绑现有etree.cpython-34m.so
二进制文件的二进制文件也不起作用,因为该二进制文件本身是固有损坏的().
卸载Python模块(不是C库),然后从源代码重新安装. (pip
应该能够自动执行此操作,前提是您已经安装了libxml2和libxslt的-devel头文件以及适当的编译器.)
Uninstall the Python module -- not the C library -- and reinstall it from source. (pip
should be able to do this automatically, assuming that you have -devel headers for libxml2 and libxslt installed and an appropriate compiler).
这篇关于“未定义符号:__xmlStructuredErrorContext";从lxml导入etree的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!