繁体   English   中英

在为Python3.5.1安装lxml时遇到问题

[英]Having trouble installing lxml for Python3.5.1

一段时间以来,我一直在试图找出如何安装lxml的方法,但是没有运气。 作为最后的希望。 我来这里是为了寻求解决方案或进行澄清。 到目前为止,我已经尝试过其他答案线程中几乎所有以前讲过的方法,但是没有运气。

首先,我尝试了以下方法:

 pip install lxml 

 pip3 install lxml

python -m pip install lxml

哪个抛出了错误...

ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
    ** make sure the development packages of libxml2 and libxslt are installed **
C:\Users\Me\AppData\Local\Temp\xmlXPathInit1owazwq3.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:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

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

然后我继续尝试安装车轮...

python -m pip install wheel 

C:\Users\Me>python -m pip install wheel
Requirement already satisfied (use --upgrade to upgrade): wheel in c:\python35\lib\site-packages

这似乎奏效了。

但是,当我尝试再次安装lxml时...

Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?

    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\cl.exe' failed with exit status 2

    Command "c:\python35\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Me\\AppData\\Local\\Temp\\pip-build-klrlh4_w\\lxml\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record C:\Users\Me\AppData\Local\Temp\pip-k3saekal-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Me\AppData\Local\Temp\pip-build-klrlh4_w\lxml\

然后,我尝试下载.whl文件。

python -m pip install lxml-3.6.0-cp35-cp35m-win_amd64.whl

^几乎下载了所有这些.whl文件
只是每个人都得出相同的结论

lxml-3.6.0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform. 

遗憾的是,这些都无法安装lxml。

lxml是否可以在python3.5.1上运行?

任何帮助都将是有帮助的:)

检查您需要使用哪个版本下载...

import sys

is_64bits = sys.maxsize > 2**32

print(is_64bits )

然后下载LXML ..正确版本http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml

所有功劳归@Manjabes- https: //stackoverflow.com/users/396571/manjabes

感谢您的帮助<3

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM