You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行pip list --outdated报错:html5lib.treebuilders.etree无getETreeModule属性

问题根因

报错由html5lib依赖和当前pip版本的接口不兼容导致:pip调用了html5lib.treebuilders.etree下的getETreeModule方法,但当前安装的html5lib版本中该接口已被移除/不存在。

解决方案
  • 方案1:升级pip至最新版本
    这是最高效的解决方式,新版本pip已经修复了该兼容问题,执行命令:
pip install --upgrade pip

如果操作的是系统全局Python环境且没有管理员权限,添加--user参数安装到当前用户目录:

pip install --upgrade pip --user
  • 方案2:重装匹配版本的html5lib
    如果升级pip后问题仍未解决,直接重装兼容版本的html5lib即可:
pip install --force-reinstall html5lib==1.1

Debian/Ubuntu系列系统也可以通过系统包管理器修复:

sudo apt reinstall python3-html5lib
  • 方案3:临时规避(不修改现有依赖)
    执行查询命令时添加--no-threads参数,跳过多线程调用逻辑即可规避报错:
pip list --outdated --format=freeze --no-threads

内容的提问来源于stack exchange,提问作者dewijones92

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.02 14:48:04