编辑你的昵称
2021-10-20 00:01
采纳率: 100%
浏览 103

请问如何解决python无法安装requests-html模块的问题?

报错如下:
Running setup.py install for lxml ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Users\GCA\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\GCA\AppData\Local\Temp\pip-install-1my9q08b\lxml_2b0ae08f193247408edb583e6b597f93\setup.py'"'"'; file='"'"'C:\Users\GCA\AppData\Local\Temp\pip-install-1my9q08b\lxml_2b0ae08f193247408edb583e6b597f93\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\GCA\AppData\Local\Temp\pip-record-n4_scp1x\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\GCA\AppData\Local\Programs\Python\Python310\Include\lxml'
C:\Users\GCA\AppData\Local\Temp\pip-install-1my9q08b\lxml_2b0ae08f193247408edb583e6b597f93\src\lxml\includes/etree_defs.h(14): fatal error C1083: 无法打开包括文件: “libxml/xmlversion.h”: No such file or directory
Compile failed: command 'D:\buildtool\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2
creating Users
creating Users\GCA
creating Users\GCA\AppData
creating Users\GCA\AppData\Local
creating Users\GCA\AppData\Local\Temp
D:\buildtool\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I/usr/include/libxml2 -ID:\buildtool\VC\Tools\MSVC\14.29.30133\include -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt -IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt /TcC:\Users\GCA\AppData\Local\Temp\xmlXPathInitsz_njp7x.c /FoUsers\GCA\AppData\Local\Temp\xmlXPathInitsz_njp7x.obj
xmlXPathInitsz_njp7x.c
C:\Users\GCA\AppData\Local\Temp\xmlXPathInitsz_njp7x.c(1): fatal error C1083: 无法打开包括文件: “libxml/xpath.h”: No such file or directory
error: command 'D:\buildtool\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit code 2
*********************************************************************************
Could not find function xmlCheckVersion in library libxml2. Is libxml2 installed?
*********************************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\GCA\AppData\Local\Programs\Python\Python310\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\GCA\AppData\Local\Temp\pip-install-1my9q08b\lxml_2b0ae08f193247408edb583e6b597f93\setup.py'"'"'; file='"'"'C:\Users\GCA\AppData\Local\Temp\pip-install-1my9q08b\lxml_2b0ae08f193247408edb583e6b597f93\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(file) if os.path.exists(file) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record 'C:\Users\GCA\AppData\Local\Temp\pip-record-n4_scp1x\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\GCA\AppData\Local\Programs\Python\Python310\Include\lxml' Check the logs for full command output.

C:\Users\GCA>

1条回答 默认 最新

相关推荐 更多相似问题