pip3 install lxml一系列报错
........................
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'i686-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
............. cc -I/usr/include/libxml2 -c /tmp/xmlXPathInitmro9i7ra.c -o tmp/xmlXPathInitmro9i7ra.o
/tmp/xmlXPathInitmro9i7ra.c:1:26: fatal error: libxml/xpath.h: 没有那个文件或目录
compilation terminated.
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
error: command 'i686-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-0n_gaind/lxml/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-tofumekn-record/install-record.txt
--single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-0n_gaind/lxml/
运行下面三个, 可能packages 会有些不一样,建议tab补全
sudo apt-get install libxml2-dev
sudo apt-get install libxslt1-dev
sudo apt-get install python3-dev
在尝试在Linux环境下使用Python3安装lxml库时遇到错误,报错表明找不到libxml2库的相关函数。编译过程失败,提示libxml2可能未安装或者路径问题。解决方案包括检查和安装必要的依赖包。
5502

被折叠的 条评论
为什么被折叠?



