Windows情况下XPath 安装失败

在使用Pip install lxml安装时发现错误

error: Setup script exited with error: command 'F:\\Program Files\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2
F:\Python_Project>src\lxml\includes\etree_defs.h(14) : fatal error C1083: 无法打开包括文件:“libxml/xmlversion.h”: No such file or directory                             
                  Compile failed: command 'F:\\Program Files\\VC\\BIN\\amd64\\cl.exe' failed with exit status 2xmlXPathInit_mlag6iv.cC:\Users\ADMINI~1\AppData\Local\Temp\
easy_install-qm02b7j9\lxml-3.6.0\temp\xmlXPathInit_mlag6iv.c(1) : fatal error C1083: 无法打开包括文件:“libxml/xpath.h”: No such file or directory             

应该是缺少某个头文件。

解决方法:

在这个网址http://www.lfd.uci.edu/~gohlke/pythonlibs/

下载lxml-3.6.0-cp35-cp35m-win_amd64.whl



在本地修改后缀名为zip并解压,将其中的lxml文件夹复制到C:\\Python34\\Lib文件夹下即可

你可能感兴趣的:(编程语言,python)