gpt4 book ai didi

python - undefined symbol : xmlMemDisplayLast error with lxml

转载 作者:太空狗 更新时间:2023-10-30 01:32:31 27 4
gpt4 key购买 nike

我在通过 pip 安装 lxml 时收到这些错误:

    running build_ext
building 'lxml.etree' extension
creating build/temp.linux-i686-3.5
creating build/temp.linux-i686-3.5/src
creating build/temp.linux-i686-3.5/src/lxml
gcc -pthread -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/libxml2 -Isrc/lxml/includes -I/usr/local/include/python3.5m -c src/lxml/lxml.etree.c -o build/temp.linux-i686-3.5/src/lxml/lxml.etree.o -w
In file included from src/lxml/lxml.etree.c:321:
src/lxml/includes/etree_defs.h:19:4: error: #error minimum required version of libxml2 is 2.7.0
src/lxml/includes/etree_defs.h:28:4: error: #error minimum required version of libxslt is 1.1.23
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_9XMLParser___init__’:
src/lxml/lxml.etree.c:113201: error: ‘XML_PARSE_HUGE’ undeclared (first use in this function)
src/lxml/lxml.etree.c:113201: error: (Each undeclared identifier is reported only once
src/lxml/lxml.etree.c:113201: error: for each function it appears in.)
src/lxml/lxml.etree.c: In function ‘__pyx_pf_4lxml_5etree_10Schematron_6__call__’:
src/lxml/lxml.etree.c:194047: error: ‘XML_SCHEMATRON_OUT_ERROR’ undeclared (first use in this function)
Compile failed: command 'gcc' failed with exit status 1
creating tmp
cc -I/usr/include/libxml2 -I/usr/include/libxml2 -c /tmp/xmlXPathInitomumkupc.c -o tmp/xmlXPathInitomumkupc.o
cc tmp/xmlXPathInitomumkupc.o -L/usr/lib -lxml2 -o a.out
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/usr/local/bin/python3.5 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-2c9_3zz2/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-du99fdnt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-2c9_3zz2/lxml/

假设某些软件包不符合要求,我尝试通过 yum 更新它们:

Package libxml2-2.6.26-2.1.25.el5_11.i386 already installed and latest version

Package libxslt-1.1.17-4.el5_8.3.i386 already installed and latest version

我在 CentOS 上使用 Python 3.5.1。没有直接的方法来安装它吗?

也许值得寻找另一个 yum 存储库?

如果我尝试通过 https://serverfault.com/questions/266927/install-libxml2-2-7-x-on-centos-5-x#305682 手动安装(libxslt 1.1.23 和 libxml 2-2.7.2)这两个包的更新,我在 Python 3.5 中尝试使用 lxml 时遇到此错误:

>>> from lxml import html
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.5/site-packages/lxml/html/__init__.py", line 54, in <module>
from .. import etree
ImportError: /usr/local/lib/python3.5/site-packages/lxml/etree.cpython-35m-i386-linux-gnu.so: undefined symbol: xmlMemDisplayLast

最佳答案

src/lxml/includes/etree_defs.h:19:4: error: #error minimum required version of libxml2 is 2.7.0
src/lxml/includes/etree_defs.h:28:4: error: #error minimum required version of libxslt is 1.1.23

libxml2-devel & libxslt-devel 的版本不满足要求。

试试 yum install libxml2-devel libxslt-devel

关于python - undefined symbol : xmlMemDisplayLast error with lxml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40754295/

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