«

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

时间:2024-3-2 12:55     作者:韩俊     分类: Python


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

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

>>> pip install lxml

C:UsersChen>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 filespythonpython.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' xb2xbbxcaxc7xc4xdaxb2xbfxbbxf2xcdxe2xb2xbfxc3xfcxc1xeexa3xacxd2xb2xb2xbbxcaxc7xbfxc9xd4xcbxd0xd0xb5xc4xb3xccxd0xf2rnxbbxf2xc 
  ** 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 buildlib.win32-3.5 
  creating buildlib.win32-3.5lxml 
  copying srclxmlbuilder.py -> buildlib.win32-3.5lxml 
  copying srclxmlcssselect.py -> buildlib.win32-3.5lxml 
  copying srclxmldoctestcompare.py -> buildlib.win32-3.5lxml 
  copying srclxmlElementInclude.py -> buildlib.win32-3.5lxml 
  copying srclxmlpyclasslookup.py -> buildlib.win32-3.5lxml 
  copying srclxmlsax.py -> buildlib.win32-3.5lxml 
  copying srclxmlusedoctest.py -> buildlib.win32-3.5lxml 
  copying srclxml_elementpath.py -> buildlib.win32-3.5lxml 
  copying srclxml__init__.py -> buildlib.win32-3.5lxml 
  creating buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludes__init__.py -> buildlib.win32-3.5lxmlincludes 
  creating buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtmlbuilder.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtmlclean.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtmldefs.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtmldiff.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtmlElementSoup.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtmlformfill.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtmlhtml5parser.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtmlsoupparser.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtmlusedoctest.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtml_diffcommand.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtml_html5builder.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtml_setmixin.py -> buildlib.win32-3.5lxmlhtml 
  copying srclxmlhtml__init__.py -> buildlib.win32-3.5lxmlhtml 
  creating buildlib.win32-3.5lxmlisoschematron 
  copying srclxmlisoschematron__init__.py -> buildlib.win32-3.5lxmlisoschematron 
  copying srclxmllxml.etree.h -> buildlib.win32-3.5lxml 
  copying srclxmllxml.etree_api.h -> buildlib.win32-3.5lxml 
  copying srclxmlincludesc14n.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesconfig.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesdtdvalid.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesetreepublic.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludeshtmlparser.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesrelaxng.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesschematron.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludestree.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesuri.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesxinclude.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesxmlerror.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesxmlparser.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesxmlschema.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesxpath.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesxslt.pxd -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludesetree_defs.h -> buildlib.win32-3.5lxmlincludes 
  copying srclxmlincludeslxml-version.h -> buildlib.win32-3.5lxmlincludes 
  creating buildlib.win32-3.5lxmlisoschematronresources 
  creating buildlib.win32-3.5lxmlisoschematronresourcesrng 
  copying srclxmlisoschematronresourcesrngiso-schematron.rng -> buildlib.win32-3.5lxmlisoschematronresourcesrng 
  creating buildlib.win32-3.5lxmlisoschematronresourcesxsl 
  copying srclxmlisoschematronresourcesxslRNG2Schtrn.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsl 
  copying srclxmlisoschematronresourcesxslXSD2Schtrn.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsl 
  creating buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1 
  copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_abstract_expand.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1 
  copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_dsdl_include.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1 
  copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_schematron_message.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1 
  copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_schematron_skeleton_for_xslt1.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1 
  copying srclxmlisoschematronresourcesxsliso-schematron-xslt1iso_svrl_for_xslt1.xsl -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-schematron-xslt1 
  copying srclxmlisoschematronresourcesxsliso-schematron-xslt1readme.txt -> buildlib.win32-3.5lxmlisoschematronresourcesxsliso-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

热门推荐