Python pip安装lxml出错的问题解决办法
Python pip安装lxml出错的问题解决办法
1. 在使用pip安装lxml过程中出现了一下错误:
>>>pipinstalllxml
C:\Users\Chen>pipinstalllxml Collectinglxml Usingcachedlxml-3.5.0.tar.gz Installingcollectedpackages:lxml Runningsetup.pyinstallforlxml...error Completeoutputfromcommand"d:\programfiles\python\python.exe"-u-c"importsetuptools,tokenize;__file__='C:\\Users\\CHENJU~1\\AppData\\Local\\Temp\\pip-build-id5180h6\\lxml\\setup.py'; Buildinglxmlversion3.5.0. BuildingwithoutCython. 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 **makesurethedevelopmentpackagesoflibxml2andlibxsltareinstalled** Usingbuildconfigurationoflibxslt runninginstall runningbuild runningbuild_py creatingbuild creatingbuild\lib.win32-3.5 creatingbuild\lib.win32-3.5\lxml copyingsrc\lxml\builder.py->build\lib.win32-3.5\lxml copyingsrc\lxml\cssselect.py->build\lib.win32-3.5\lxml copyingsrc\lxml\doctestcompare.py->build\lib.win32-3.5\lxml copyingsrc\lxml\ElementInclude.py->build\lib.win32-3.5\lxml copyingsrc\lxml\pyclasslookup.py->build\lib.win32-3.5\lxml copyingsrc\lxml\sax.py->build\lib.win32-3.5\lxml copyingsrc\lxml\usedoctest.py->build\lib.win32-3.5\lxml copyingsrc\lxml\_elementpath.py->build\lib.win32-3.5\lxml copyingsrc\lxml\__init__.py->build\lib.win32-3.5\lxml creatingbuild\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\__init__.py->build\lib.win32-3.5\lxml\includes creatingbuild\lib.win32-3.5\lxml\html copyingsrc\lxml\html\builder.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\clean.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\defs.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\diff.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\ElementSoup.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\formfill.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\html5parser.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\soupparser.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\usedoctest.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\_diffcommand.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\_html5builder.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\_setmixin.py->build\lib.win32-3.5\lxml\html copyingsrc\lxml\html\__init__.py->build\lib.win32-3.5\lxml\html creatingbuild\lib.win32-3.5\lxml\isoschematron copyingsrc\lxml\isoschematron\__init__.py->build\lib.win32-3.5\lxml\isoschematron copyingsrc\lxml\lxml.etree.h->build\lib.win32-3.5\lxml copyingsrc\lxml\lxml.etree_api.h->build\lib.win32-3.5\lxml copyingsrc\lxml\includes\c14n.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\config.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\dtdvalid.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\etreepublic.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\htmlparser.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\relaxng.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\schematron.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\tree.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\uri.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\xinclude.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\xmlerror.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\xmlparser.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\xmlschema.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\xpath.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\xslt.pxd->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\etree_defs.h->build\lib.win32-3.5\lxml\includes copyingsrc\lxml\includes\lxml-version.h->build\lib.win32-3.5\lxml\includes creatingbuild\lib.win32-3.5\lxml\isoschematron\resources creatingbuild\lib.win32-3.5\lxml\isoschematron\resources\rng copyingsrc\lxml\isoschematron\resources\rng\iso-schematron.rng->build\lib.win32-3.5\lxml\isoschematron\resources\rng creatingbuild\lib.win32-3.5\lxml\isoschematron\resources\xsl copyingsrc\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl->build\lib.win32-3.5\lxml\isoschematron\resources\xsl copyingsrc\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl->build\lib.win32-3.5\lxml\isoschematron\resources\xsl creatingbuild\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copyingsrc\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl->build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copyingsrc\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl->build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copyingsrc\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl->build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copyingsrc\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 copyingsrc\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_svrl_for_xslt1.xsl->build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 copyingsrc\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt->build\lib.win32-3.5\lxml\isoschematron\resources\xsl\iso-schematron-xslt1 runningbuild_ext building'lxml.etree'extension error:Unabletofindvcvarsall.bat ----------------------------------------
2. Baidu一下看看问题如何解决:
原来这个问题,还是需要区分操作系统来分别处理的。window下暂无涉及。
3. Linux系统的处理方式:
sudoapt-getinstallpython-devlibxml2-devlibxslt1-devzlib1g-dev
oryuminstall.....
然后继续使用pipinstalllxml
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!