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

新手求助:使用pip安装python-docx失败(lxml相关报错)

解决pip安装python-docx失败的问题

你的问题出在安装python-docx依赖的lxml包时,缺少wheel工具导致只能用旧的安装方式,进而失败。按以下步骤操作:

  • 先安装wheel工具,它能帮你顺利安装需要编译的Python包:
    pip install wheel
    
  • 安装完wheel后,重新尝试安装python-docx:
    pip install python-docx
    
    或者指定你需要的版本:
    pip install python-docx==0.8.11
    
  • 如果还是报错,先单独安装lxml再装python-docx:
    pip install lxml
    
  • 另外,确保你的pip是最新版本,更新pip的命令:
    python -m pip install --upgrade pip
    

内容的提问来源于stack exchange,提问作者Fischbrötchen

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.13 23:45:41