python 3.6 lxml包安装过程记录


安装其他模块时候提示需要安装lxml

本来 pip install lxml,

提示出错,说要安装 Microsoft Visual C++ 14.0 is required,, 根据提示到下面网站下载:

http://landinghub.visualstudio.com/visual-cpp-build-tools

下载了个visualcppbuildtools_full.exe,选择windows 8.1 SDK和.net framework SDK安装,

----------------------------------------------------------------------------
PS C:\Users\CuteYear> pip install --trusted-host https://pypi.tuna.tsinghua.edu.cn/simple lxml
Collecting lxml
  Using cached lxml-3.7.1.tar.gz
Installing collected packages: lxml
  Running setup.py install for lxml ... error
    Complete output from command c:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\CuteYear
\\AppData\\Local\\Temp\\pip-build-um0yxhqh\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().re
place('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\CuteYear\AppData\Local\Te
.....

.......

ml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win-amd64-
3.6\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib
.win-amd64-3.6\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win-amd64-3.6\
lxml\isoschematron\resources\xsl\iso-schematron-xslt1
    copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win-amd64-3.6\lxml\isosche
matron\resources\xsl\iso-schematron-xslt1
    running build_ext
    building 'lxml.etree' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visu
alstudio.com/visual-cpp-build-tools


    ----------------------------------------
Command "c:\python36\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\CuteYear\\AppData\\Local\\Temp\\
pip-build-um0yxhqh\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.cl
ose();exec(compile(code, __file__, 'exec'))" install --record C:\Users\CuteYear\AppData\Local\Temp\pip-ysk7nf97-record\i
nstall-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\CuteYear\AppData\L
ocal\Temp\pip-build-um0yxhqh\lxml\,


安装完成Microsoft Visual C++ 14.0后,重新运行pip install lxml

又提示另外错误,发现也没办法安装libxml2,不知咋回事,

索性又卸载了Microsoft Visual C++ 14.0,

根据stackoverflow上的讨论(http://stackoverflow.com/questions/29440482/how-to-install-lxml-on-windows)

到这里直接下载lxml windows insaller

     http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml

我的是系统是windows8.1 x64,选择这个安装:lxml‑3.7.1‑cp36‑cp36m‑win_amd64.whl


下载上述whl之后,手动安装即可:

 pip install .\lxml-3.7.1-cp36-cp36m-win_amd64.whl

  • 0
    点赞
  • 0
    收藏
  • 打赏
    打赏
  • 0
    评论

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

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
©️2022 CSDN 皮肤主题:编程工作室 设计师:CSDN官方博客 返回首页
评论

打赏作者

doyanger

你的鼓励将是我创作的最大动力

¥2 ¥4 ¥6 ¥10 ¥20
输入1-500的整数
余额支付 (余额:-- )
扫码支付
扫码支付:¥2
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值