当前位置:首页 > PHP教程 > php应用 > 列表

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

发布:smiling 来源: PHP粉丝网  添加日期:2018-08-02 09:18:05 浏览: 评论:0 

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

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

>>> pip install lxml

  1. C:\Users\Chen>pip install lxml 
  2. Collecting lxml 
  3.  Using cached lxml-3.5.0.tar.gz 
  4. Installing collected packages: lxml 
  5.  Running setup.py installforlxml ... error 
  6.   Complete outputfromcommand"d:\program files\python\python.exe"-u-c "importsetuptools, tokenize;__file__='C:\\Users\\CHENJU~1\\AppData\\Local\\Temp\\pip-build-id5180h6\\lxml\\setup.py' 
  7.   Building lxml version3.5.0. 
  8.   Building without Cython. 
  9.   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 
  10.   **make sure the development packages of libxml2andlibxslt are installed** 
  11.    
  12.   Using build configuration of libxslt 
  13.   running install 
  14.   running build 
  15.   running build_py 
  16.   creating build 
  17.   creating build\lib.win32-3.5 
  18.   creating build\lib.win32-3.5\lxml 
  19.   copying src\lxml\builder.py-> build\lib.win32-3.5\lxml 
  20.   copying src\lxml\<a href="http://www.111cn.net/cssdiv/css.html" class="anchor" target="_blank">css</a><a href="/tags.php/select/" target="_blank">select</a>.py-> build\lib.win32-3.5\lxml 
  21.   copying src\lxml\doctestcompare.py-> build\lib.win32-3.5\lxml 
  22.   copying src\lxml\ElementInclude.py-> build\lib.win32-3.5\lxml 
  23.   copying src\lxml\pyclasslookup.py-> build\lib.win32-3.5\lxml 
  24.   copying src\lxml\sax.py-> build\lib.win32-3.5\lxml 
  25.   copying src\lxml\usedoctest.py-> build\lib.win32-3.5\lxml 
  26.   copying src\lxml\_elementpath.py-> build\lib.win32-3.5\lxml 
  27.   copying src\lxml\__init__.py-> build\lib.win32-3.5\lxml 
  28.   creating build\lib.win32-3.5\lxml\<a href="/tags.php/include/" target="_blank">include</a>s 
  29.   copying src\lxml\includes\__init__.py-> build\lib.win32-3.5\lxml\includes 
  30.   creating build\lib.win32-3.5\lxml\html 
  31.   copying src\lxml\html\builder.py-> build\lib.win32-3.5\lxml\html 
  32.   copying src\lxml\html\clean.py-> build\lib.win32-3.5\lxml\html 
  33.   copying src\lxml\html\defs.py-> build\lib.win32-3.5\lxml\html 
  34.   copying src\lxml\html\diff.py-> build\lib.win32-3.5\lxml\html 
  35.   copying src\lxml\html\ElementSoup.py-> build\lib.win32-3.5\lxml\html 
  36.   copying src\lxml\html\formfill.py-> build\lib.win32-3.5\lxml\html 
  37.   copying src\lxml\html\html5parser.py-> build\lib.win32-3.5\lxml\html 
  38.   copying src\lxml\html\soupparser.py-> build\lib.win32-3.5\lxml\html 
  39.   copying src\lxml\html\usedoctest.py-> build\lib.win32-3.5\lxml\html 
  40.   copying src\lxml\html\_diffcommand.py-> build\lib.win32-3.5\lxml\html 
  41.   copying src\lxml\html\_html5builder.py-> build\lib.win32-3.5\lxml\html 
  42.   copying src\lxml\html\_setmixin.py-> build\lib.win32-3.5\lxml\html 
  43.   copying src\lxml\html\__init__.py-> build\lib.win32-3.5\lxml\html 
  44.   creating build\lib.win32-3.5\lxml\isoschematron 
  45.   copying src\lxml\isoschematron\__init__.py-> build\lib.win32-3.5\lxml\isoschematron 
  46.   copying src\lxml\lxml.etree.h-> build\lib.win32-3.5\lxml 
  47.   copying src\lxml\lxml.etree_api.h-> build\lib.win32-3.5\lxml 
  48.   copying src\lxml\includes\c14n.pxd-> build\lib.win32-3.5\lxml\includes 
  49.   copying src\lxml\includes\config.pxd-> build\lib.win32-3.5\lxml\includes 
  50.   copying src\lxml\includes\dtdvalid.pxd-> build\lib.win32-3.5\lxml\includes 
  51.   copying src\lxml\includes\etreepublic.pxd-> build\lib.win32-3.5\lxml\includes 
  52.   copying src\lxml\includes\htmlparser.pxd-> build\lib.win32-3.5\lxml\includes 
  53.   copying src\lxml\includes\relaxng.pxd-> build\lib.win32-3.5\lxml\includes 
  54.   copying src\lxml\includes\schematron.pxd-> build\lib.win32-3.5\lxml\includes 
  55.   copying src\lxml\includes\tree.pxd-> build\lib.win32-3.5\lxml\includes 
  56.   copying src\lxml\includes\uri.pxd-> build\lib.win32-3.5\lxml\includes 
  57.   copying src\lxml\includes\xinclude.pxd-> build\lib.win32-3.5\lxml\includes 
  58.   copying src\lxml\includes\xmlerror.pxd-> build\lib.win32-3.5\lxml\includes 
  59.   copying src\lxml\includes\xmlparser.pxd-> build\lib.win32-3.5\lxml\includes 
  60.   copying src\lxml\includes\xmlschema.pxd-> build\lib.win32-3.5\lxml\includes 
  61.   copying src\lxml\includes\xpath.pxd-> build\lib.win32-3.5\lxml\includes 
  62.   copying src\lxml\includes\xslt.pxd-> build\lib.win32-3.5\lxml\includes 
  63.   copying src\lxml\includes\etree_defs.h-> build\lib.win32-3.5\lxml\includes 
  64.   copying src\lxml\includes\lxml-version.h-> build\lib.win32-3.5\lxml\includes 
  65.   creating build\lib.win32-3.5\lxml\isoschematron\resources 
  66.   creating build\lib.win32-3.5\lxml\isoschematron\resources\rng 
  67.   copying src\lxml\isoschematron\resources\rng\iso-schematron.rng-> build\lib.win32-3.5\lxml\isoschematron\resources\rng 
  68.   creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl 
  69.   copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl-> build\lib.win32-3.5\lxml\isoschematron\resources\xsl 
  70.   copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl-> build\lib.win32-3.5\lxml\isoschematron\resources\xsl 
  71.   creating build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  72.   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 
  73.   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 
  74.   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 
  75.   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 
  76.   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 
  77.   copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt-> build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 
  78.   running build_ext 
  79.   building'lxml.etree'extension 
  80.   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

Tags:

分享到: