Python: Win7下使用 pip install lxml 无法安装lxml

在Windows 7环境下,使用pip安装lxml时遇到错误,包括'xslt-config'命令未找到,libxml相关头文件缺失等问题。尝试通过手动下载lxml的whl文件进行安装。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


Building wheels for collected packages: lxml
  Running setup.py bdist_wheel for lxml ... error
  Complete output from command c:\python\venv27\scripts\python.exe -u -c "import setuptools, tokeniz
e;__file__='c:\\users\\john\\appdata\\local\\temp\\pip-build-onqfjv\\lxml\\setup.py';exec(compile(ge
tattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_whee
l -d c:\users\john\appdata\local\temp\tmp_k_igspip-wheel- --python-tag cp27:



  Building without Cython.
  ERROR: 'xslt-config' 不是内部或外部命令,也不是可运行的程序
  或批处理文件。


  src\lxml\includes\etree_defs.h(14) : fatal error C1083: Cannot open include file: 'libxml/xmlversi
on.h': No such file or directory
  Compile failed: command 'C:\\Users\\John\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++
for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2



  c:\users\john\appdata\local\temp\xmlXPathInit86c5ei.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\\John\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Pytho
n\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2

  ----------------------------------------
  Failed building wheel for lxml




到pypi网站下载

https://pypi.python.org/pypi/lxml/3.6.0



File

 TypePy VersionUploaded onSize
lxml-3.6.0-cp26-none-win32.whl (md5)Python Wheel2.62016-03-222MB
lxml-3.6.0-cp26-none-win_amd64.whl (md5)Python Wheel2.62016-03-223MB
lxml-3.6.0-cp27-none-win32.whl (md5)Python Wheel2.72016-03-222MB
lxml-3.6.0-cp27-none-win_amd64.whl (md5)Python Wheel2.72016-03-223MB
lxml-3.6.0-cp32-none-win32.whl (md5)Python Wheel3.22016-03-222MB
lxml-3.6.0-cp32-none-win_amd64.whl (md5)Python Wheel3.22016-07-243MB
lxml-3.6.0-cp33-none-win32.whl (md5)Python Wheel3.32016-07-242MB
lxml-3.6.0-cp33-none-win_amd64.whl (md5)Python Wheel3.32016-07-243MB
lxml-3.6.0-cp34-none-win32.whl (md5)Python Wheel3.42016-07-242MB
lxml-3.6.0-cp34-none-win_amd64.whl (md5)Python Wheel3.42016-07-243MB
lxml-3.6.0.tar.gz (md5,pgp) Source 2016-03-173MB
lxml-3.6.0.win-amd64-py2.6.exe (md5)MS Windows installer2.62016-03-223MB
lxml-3.6.0.win-amd64-py2.7.exe (md5)MS Windows installer2.72016-03-223MB
lxml-3.6.0.win-amd64-py3.2.exe (md5)MS Windows installer3.22016-06-083MB
lxml-3.6.0.win-amd64-py3.3.exe (md5)MS Windows installer3.32016-06-083MB
lxml-3.6.0.win-amd64-py3.4.exe (md5)MS Windows installer3.42016-06-083MB
lxml-3.6.0.win32-py2.6.exe (md5)MS Windows installer2.62016-03-223MB
lxml-3.6.0.win32-py2.7.exe (md5)MS Windows installer2.72016-03-223MB
lxml-3.6.0.win32-py3.2.exe (md5)MS Windows installer3.22016-03-223MB
lxml-3.6.0.win32-py3.3.exe (md5)MS Windows installer3.32016-06-083MB
lxml-3.6.0.win32-py3.4.exe (md5)MS Windows installer3.42016-06-083MB


pip install lxml-3.6.0-cp27-none-win_amd64.whl




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值