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

求助:执行pip install -r requirements.txt遇torch版本匹配错误

解决torch==1.11.0+cu113安装失败问题
  • 该版本无法通过默认pip源找到,因为PyTorch的CUDA专属版本未上传至默认PyPI索引,需指定官方源安装
  • 先清理已安装的torch(若存在):
    pip uninstall -y torch
    
  • 直接安装指定版本:
    pip install torch==1.11.0+cu113 -f https://download.pytorch.org/whl/cu113/torch_stable.html
    
  • 若要通过requirements.txt安装,修改文件中对应行:
    torch==1.11.0+cu113 --find-links https://download.pytorch.org/whl/cu113/torch_stable.html
    
    再执行pip install -r requirements.txt
  • 验证安装结果:
    import torch
    print(torch.version.cuda)
    print(torch.__version__)
    
    正常情况下会分别输出11.3和1.11.0+cu113

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.16 17:29:53