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

作者:lqh 时间:2021-11-17 07:36:07 

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,pip
0
投稿

猜你喜欢

  • 详解SQL Server中数据库快照工作原理

    2009-01-21 14:18:00
  • Mysql的复合索引如何生效

    2024-01-26 06:53:17
  • win10下安装两个MySQL5.6.35数据库

    2024-01-16 00:50:07
  • PHP autoload使用方法及步骤详解

    2023-08-22 13:05:44
  • 浅谈Python爬取网页的编码处理

    2021-02-03 19:55:56
  • JavaScript中 this 指向问题深度解析

    2024-05-03 15:04:14
  • Pytorch中torch.flatten()和torch.nn.Flatten()实例详解

    2021-09-15 06:39:43
  • Vue编写多地区选择组件

    2024-06-07 15:24:40
  • 基于OpenCV和Gradio实现简单的人脸识别详解

    2022-10-21 22:59:11
  • Python实现连接MySql数据库及增删改查操作详解

    2024-01-14 10:40:36
  • Microsoft SQL Server 安全问题

    2010-07-26 13:20:00
  • python判断变量是否为int、字符串、列表、元组、字典的方法详解

    2022-09-28 05:11:57
  • python自动化测试selenium核心技术三种等待方式详解

    2023-09-16 09:06:04
  • 解决MySQL安装重装时出现could not start the service mysql error:0问题的方法

    2024-01-23 01:17:00
  • 我的javascript小扎

    2008-08-12 13:04:00
  • 只需7行Python代码玩转微信自动聊天

    2021-03-09 09:03:22
  • 浅谈Python中的数据类型

    2022-11-29 06:19:22
  • python简单鼠标自动点击某区域的实例

    2021-03-05 16:35:52
  • javascript结合canvas实现图片旋转效果

    2023-08-07 23:47:59
  • mysql存储过程 在动态SQL内获取返回值的方法详解

    2024-01-19 01:22:53
  • asp之家 网络编程 m.aspxhome.com