python winthows下安装lxml失败解决方法

安装lxml总是失败解决方法

失败提示如下:

    running build_ext
    building 'lxml.etree' extension
    creating build\temp.win-amd64-2.7
    creating build\temp.win-amd64-2.7\Release
    creating build\temp.win-amd64-2.7\Release\src
    creating build\temp.win-amd64-2.7\Release\src\lxml
    C:\Users\wenshiwei\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -Isrc\lxml\inc
ludes -Ic:\apps\tools\python27\include -Ic:\apps\tools\python27\PC /Tcsrc\lxml\lxml.etree.c /Fobuild\temp.win-amd64-2.7\Release\src\lxml\lxml.etree.obj -w
    cl : Command line warning D9025 : overriding '/W3' with '/w'
    lxml.etree.c
    src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
    Compile failed: command 'C:\\Users\\wenshiwei\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with
exit status 2
    C:\Users\wenshiwei\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\amd64\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -I/usr/include
/libxml2 /Tcc:\users\wenshi~1\appdata\local\temp\xmlXPathInitqpboxi.c /Fousers\wenshi~1\appdata\local\temp\xmlXPathInitqpboxi.obj
    xmlXPathInitqpboxi.c
    c:\users\wenshi~1\appdata\local\temp\xmlXPathInitqpboxi.c(1) : fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
    *********************************************************************************
    Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
    *********************************************************************************
    error: command 'C:\\Users\\wenshiwei\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit stat
us 2

    ----------------------------------------
Command "c:\apps\tools\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\wenshi~1\\appdata\\local\\temp\\pip-build-mavckn\\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 c:\users\
wenshi~1\appdata\local\temp\pip-jal9v1-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\wenshi~1\ap
pdata\local\temp\pip-build-mavckn\lxml\


如果安装了VC++一样失败, 可以试试使用 wheel 安装, 已经被编绎过的

pip install wheel


接着下载 相应的.whl包

下载地址     http://www.lfd.uci.edu/~gohlke/pythonlibs




  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值