Python  pip安装lxml出错的问题解决办法


Posted in Python onFebruary 10, 2017

Python  pip安装lxml出错的问题解决办法

1.  在使用pip安装lxml过程中出现了一下错误:

   >>> pip install lxml

C:\Users\Chen>pip install lxml 
Collecting lxml 
 Using cached lxml-3.5.0.tar.gz 
Installing collected packages: lxml 
 Running setup.py install for lxml ... error 
  Complete output from command "d:\program files\python\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\CHENJU~1\\AppData\\Local\\Temp\\pip-build-id5180h6\\lxml\\setup.py'; 
  Building lxml version 3.5.0. 
  Building without Cython. 
  ERROR: b"'xslt-config' \xb2\xbb\xca\xc7\xc4\xda\xb2\xbf\xbb\xf2\xcd\xe2\xb2\xbf\xc3\xfc\xc1\xee\xa3\xac\xd2\xb2\xb2\xbb\xca\xc7\xbf\xc9\xd4\xcb\xd0\xd0\xb5\xc4\xb3\xcc\xd0\xf2\r\n\xbb\xf2\xc 
  ** make sure the development packages of libxml2 and libxslt are installed ** 
 
  Using build configuration of libxslt 
  running install 
  running build 
  running build_py 
  creating build 
  creating build\lib.win32-3.5 
  creating build\lib.win32-3.5\lxml 
  copying src\lxml\builder.py -> build\lib.win32-3.5\lxml 
  copying src\lxml\cssselect.py -> build\lib.win32-3.5\lxml 
  copying src\lxml\doctestcompare.py -> build\lib.win32-3.5\lxml 
  copying src\lxml\ElementInclude.py -> build\lib.win32-3.5\lxml 
  copying src\lxml\pyclasslookup.py -> build\lib.win32-3.5\lxml 
  copying src\lxml\sax.py -> build\lib.win32-3.5\lxml 
  copying src\lxml\usedoctest.py -> build\lib.win32-3.5\lxml 
  copying src\lxml\_elementpath.py -> build\lib.win32-3.5\lxml 
  copying src\lxml\__init__.py -> build\lib.win32-3.5\lxml 
  creating build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\__init__.py -> build\lib.win32-3.5\lxml\includes 
  creating build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\builder.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\clean.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\defs.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\diff.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\ElementSoup.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\formfill.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\html5parser.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\soupparser.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\usedoctest.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\_diffcommand.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\_html5builder.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\_setmixin.py -> build\lib.win32-3.5\lxml\html 
  copying src\lxml\html\__init__.py -> build\lib.win32-3.5\lxml\html 
  creating build\lib.win32-3.5\lxml\isoschematron 
  copying src\lxml\isoschematron\__init__.py -> build\lib.win32-3.5\lxml\isoschematron 
  copying src\lxml\lxml.etree.h -> build\lib.win32-3.5\lxml 
  copying src\lxml\lxml.etree_api.h -> build\lib.win32-3.5\lxml 
  copying src\lxml\includes\c14n.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\config.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\relaxng.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\schematron.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\tree.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\uri.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\xinclude.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\xpath.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\xslt.pxd -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\etree_defs.h -> build\lib.win32-3.5\lxml\includes 
  copying src\lxml\includes\lxml-version.h -> build\lib.win32-3.5\lxml\includes 
  creating build\lib.win32-3.5\lxml\isoschematron\resources 
  creating build\lib.win32-3.5\lxml\isoschematron\resources\rng 
  copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-3.5\lxml\isoschematron\resources\rng 
  creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl 
  copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl 
  copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl 
  creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_skeleton_for_xslt1.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  running build_ext 
  building 'lxml.etree' extension 
  error: Unable to find vcvarsall.bat 
 
  ----------------------------------------

2.  Baidu一下看看问题如何解决:

    原来这个问题,还是需要区分操作系统来分别处理的。window下暂无涉及。

3.  Linux系统的处理方式:

sudo apt-get install python-dev libxml2-dev libxslt1-dev zlib1g-dev

   or yum install .....

   然后继续使用 pip install lxml

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!

Python 相关文章推荐
Python判断文件和文件夹是否存在的方法
May 21 Python
python操作redis的方法
Jul 07 Python
python利用MethodType绑定方法到类示例代码
Aug 27 Python
Python温度转换实例分析
Jan 17 Python
Django实现全文检索的方法(支持中文)
May 14 Python
详解Django 中是否使用时区的区别
Jun 14 Python
numpy使用fromstring创建矩阵的实例
Jun 15 Python
python实现泊松图像融合
Jul 26 Python
用于业余项目的8个优秀Python库
Sep 21 Python
python+selenium实现自动化百度搜索关键词
Jun 03 Python
Python中的list与tuple集合区别解析
Oct 12 Python
Python反爬虫伪装浏览器进行爬虫
Feb 28 Python
使用Python脚本和ADB命令实现卸载App
Feb 10 #Python
Python中str is not callable问题详解及解决办法
Feb 10 #Python
python用Pygal如何生成漂亮的SVG图像详解
Feb 10 #Python
Ubuntu下创建虚拟独立的Python环境全过程
Feb 10 #Python
简单谈谈Python中的几种常见的数据类型
Feb 10 #Python
Python使用QQ邮箱发送Email的方法实例
Feb 09 #Python
python3中bytes和string之间的互相转换
Feb 09 #Python
You might like
关于PHP堆栈与列队的学习
2013/06/21 PHP
PHP中使用Imagick实现各种图片效果实例
2015/01/21 PHP
thinkphp5 + ajax 使用formdata提交数据(包括文件上传) 后台返回json完整实例
2020/03/02 PHP
怎么用javascript进行拖拽
2006/07/20 Javascript
javascript 获取select下拉列表值的代码
2009/09/07 Javascript
jQuery 使用手册(六)
2009/09/23 Javascript
JavaScript验证电子邮箱的函数
2014/08/22 Javascript
jQuery实现无限往下滚动效果代码
2016/04/16 Javascript
第一次接触神奇的前端框架vue.js
2016/12/01 Javascript
jQuery简单获取DIV和A标签元素位置的方法
2017/02/07 Javascript
vue.js中指令Directives详解
2017/03/20 Javascript
详解vue.js2.0父组件点击触发子组件方法
2017/05/10 Javascript
javascript闭包的使用之按钮切换功能
2018/08/30 Javascript
angularJs中$scope数据序列化的实例
2018/09/30 Javascript
Vue实现点击当前行变色
2020/12/14 Vue.js
[15:20]DOTA2亚洲邀请赛总决赛开幕式表演:羽泉献唱
2017/04/05 DOTA
Python多进程同步简单实现代码
2016/04/27 Python
听歌识曲--用python实现一个音乐检索器的功能
2016/11/15 Python
python 编程之twisted详解及简单实例
2017/01/28 Python
使用pandas中的DataFrame数据绘制柱状图的方法
2018/04/10 Python
Python爬虫框架scrapy实现downloader_middleware设置proxy代理功能示例
2018/08/04 Python
Python实现正则表达式匹配任意的邮箱方法
2018/12/20 Python
python实现播放音频和录音功能示例代码
2018/12/30 Python
Python自定义一个类实现字典dict功能的方法
2019/01/19 Python
python代码xml转txt实例
2020/03/10 Python
python实现AdaBoost算法的示例
2020/10/03 Python
html5 Web SQL Database 之事务处理函数transaction与executeSQL解析
2013/11/07 HTML / CSS
Missguided美国官网:英国时尚品牌
2018/01/18 全球购物
董事长助理岗位职责
2014/02/18 职场文书
公司会计主管岗位责任制
2014/03/01 职场文书
陈欧的广告词
2014/03/18 职场文书
心理咨询承诺书
2014/05/20 职场文书
乡镇党员群众路线教育实践活动对照检查材料思想汇报
2014/10/05 职场文书
初中教师德育工作总结2015
2015/05/12 职场文书
Unicode中的CJK(中日韩统一表意文字)字符小结
2021/12/06 HTML / CSS
python 闭包函数详细介绍
2022/04/19 Python