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

请问如何解决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条回答

      报告相同问题?

      相关推荐 更多相似问题

      问题事件

      • 系统已结题 10月28日
      • 已采纳回答 10月20日
      • 创建了问题 10月20日

      悬赏问题

      • ¥15 android object box 一个实体多个表怎么写
      • ¥15 temux 启用docker 服务失败
      • ¥15 Flask 使用celery发送邮件出现‘目标计算机积极拒绝‘
      • ¥60 老人用的sd卡在手机里面不知道操作了什么,导致图片和视频变成了文件,取下sd卡连接电脑就是图中的样子,后缀改为.jpg才可以,需要用系统的画图软件才能打开,文件属性还是文件,有没有批量操作的解决办法
      • ¥15 超时跳出方法代码的返回值问题
      • ¥15 汇编语言程序设计设计,ascii码求数,再求数的BCD码
      • ¥30 Mask rcnn训练自己的数据集出现问题!
      • ¥20 研究人工智能时的几个问题
      • ¥15 mysql的sql查询写法问题
      • ¥15 Python中导入模块中的函数运行出错