解决使用pip安装lxml包报错问题Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

    xiaoxiao2022-07-03  101

      C:\Users\DALL\AppData\Local\Temp\xmlXPathInit_0nqpp85.c(1): fatal error C1083: 无法打开包括文件: “libxml/xpath.h”: No such file or directory   error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2   *********************************************************************************   Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?   *********************************************************************************

     

    解决办法:找到网站https://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml,

    选择对应的安装文件,我的是python3.8 所以选择的是"lxml‑4.3.3‑cp38‑cp38m‑win32.whl",点击下载,然后再cmd中进入下载文件夹,然后用pip install lxml‑4.3.3‑cp38‑cp38m‑win32.whl 安装成功。

    最新回复(0)