我正在努力将lxml
安装到Pycharm中,因此在没有它的情况下编码会遇到问题。有人可以帮忙吗?下面是错误。预先感谢。
Collecting lxml
Using cached https://files.pythonhosted.org/packages/39/2b/0a66d5436f237aff76b91e68b4d8c041d145ad0a2cdeefe2c42f76ba2857/lxml-4.5.0.tar.gz
Installing collected packages: lxml
Running setup.py install for lxml: started
Running setup.py install for lxml: finished with status 'error'
Complete output from command C:\Users\chonu\PycharmProjects\untitled\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\chonu\\AppData\\Local\\Temp\\pycharm-packaging\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\chonu\AppData\Local\Temp\pip-record-rhdhys1d\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\chonu\PycharmProjects\untitled\venv\include\site\python3.8\lxml:
Building lxml version 4.5.0.
Building without Cython.
ERROR: b"'xslt-config' is not recognized as an internal or external command,\r\noperable program or batch file.\r\n"
** 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.8
creating build\lib.win32-3.8\lxml
copying src\lxml\builder.py -> build\lib.win32-3.8\lxml
copying src\lxml\cssselect.py -> build\lib.win32-3.8\lxml
copying src\lxml\doctestcompare.py -> build\lib.win32-3.8\lxml
copying src\lxml\ElementInclude.py -> build\lib.win32-3.8\lxml
copying src\lxml\pyclasslookup.py -> build\lib.win32-3.8\lxml
copying src\lxml\sax.py -> build\lib.win32-3.8\lxml
copying src\lxml\usedoctest.py -> build\lib.win32-3.8\lxml
copying src\lxml\_elementpath.py -> build\lib.win32-3.8\lxml
copying src\lxml\__init__.py -> build\lib.win32-3.8\lxml
creating build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\__init__.py -> build\lib.win32-3.8\lxml\includes
creating build\lib.win32-3.8\lxml\html
copying src\lxml\html\builder.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\clean.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\defs.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\diff.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\ElementSoup.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\formfill.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\html5parser.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\soupparser.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\usedoctest.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\_diffcommand.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\_html5builder.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\_setmixin.py -> build\lib.win32-3.8\lxml\html
copying src\lxml\html\__init__.py -> build\lib.win32-3.8\lxml\html
creating build\lib.win32-3.8\lxml\isoschematron
copying src\lxml\isoschematron\__init__.py -> build\lib.win32-3.8\lxml\isoschematron
copying src\lxml\etree.h -> build\lib.win32-3.8\lxml
copying src\lxml\etree_api.h -> build\lib.win32-3.8\lxml
copying src\lxml\lxml.etree.h -> build\lib.win32-3.8\lxml
copying src\lxml\lxml.etree_api.h -> build\lib.win32-3.8\lxml
copying src\lxml\includes\c14n.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\config.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\dtdvalid.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\etreepublic.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\htmlparser.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\relaxng.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\schematron.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\tree.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\uri.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xinclude.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xmlerror.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xmlparser.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xmlschema.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xpath.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\xslt.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\__init__.pxd -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\etree_defs.h -> build\lib.win32-3.8\lxml\includes
copying src\lxml\includes\lxml-version.h -> build\lib.win32-3.8\lxml\includes
creating build\lib.win32-3.8\lxml\isoschematron\resources
creating build\lib.win32-3.8\lxml\isoschematron\resources\rng
copying src\lxml\isoschematron\resources\rng\iso-schematron.rng -> build\lib.win32-3.8\lxml\isoschematron\resources\rng
creating build\lib.win32-3.8\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\RNG2Schtrn.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl
copying src\lxml\isoschematron\resources\xsl\XSD2Schtrn.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl
creating build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_abstract_expand.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_dsdl_include.xsl -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\iso_schematron_message.xsl -> build\lib.win32-3.8\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.8\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.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
copying src\lxml\isoschematron\resources\xsl\iso-schematron-xslt1\readme.txt -> build\lib.win32-3.8\lxml\isoschematron\resources\xsl\iso-schematron-xslt1
warning: build_py: byte-compiling is disabled, skipping.
running build_ext
building 'lxml.etree' extension
creating build\temp.win32-3.8
creating build\temp.win32-3.8\Release
creating build\temp.win32-3.8\Release\src
creating build\temp.win32-3.8\Release\src\lxml
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DCYTHON_CLINE_IN_TRACEBACK=0 -Isrc -Isrc\lxml\includes -IC:\Users\chonu\PycharmProjects\untitled\venv\include -IC:\Users\chonu\AppData\Local\Programs\Python\Python38-32\include -IC:\Users\chonu\AppData\Local\Programs\Python\Python38-32\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /Tcsrc\lxml\etree.c /Fobuild\temp.win32-3.8\Release\src\lxml\etree.obj -w
cl : Command line warning D9025 : overriding '/W3' with '/w'
etree.c
c:\users\chonu\appdata\local\temp\pycharm-packaging\lxml\src\lxml\includes/etree_defs.h(14): fatal error C1083: Cannot open include file: 'libxml/xmlversion.h': No such file or directory
Compile failed: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
creating Users
creating Users\chonu
creating Users\chonu\AppData
creating Users\chonu\AppData\Local
creating Users\chonu\AppData\Local\Temp
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/include/libxml2 "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.17763.0\cppwinrt" /TcC:\Users\chonu\AppData\Local\Temp\xmlXPathInitwfdou72i.c /FoUsers\chonu\AppData\Local\Temp\xmlXPathInitwfdou72i.obj
xmlXPathInitwfdou72i.c
C:\Users\chonu\AppData\Local\Temp\xmlXPathInitwfdou72i.c(1): fatal error C1083: Cannot open include file: 'libxml/xpath.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x86\\cl.exe' failed with exit status 2
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
----------------------------------------
Command "C:\Users\chonu\PycharmProjects\untitled\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\chonu\\AppData\\Local\\Temp\\pycharm-packaging\\lxml\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\chonu\AppData\Local\Temp\pip-record-rhdhys1d\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\chonu\PycharmProjects\untitled\venv\include\site\python3.8\lxml" failed with error code 1 in C:\Users\chonu\AppData\Local\Temp\pycharm-packaging\lxml\