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

Python 3.10.10环境下无法安装Torch的问题求助

PyTorch安装失败(Python 3.10.10)解决办法

问题重现

D:>pip install torch
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

D:>pip3 install torch torchvision torchaudio
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

解决步骤

  • 更新pip到最新版本
    旧版pip可能无法识别PyTorch的兼容包索引,执行以下命令更新:
    python -m pip install --upgrade pip --user

  • 指定兼容的PyTorch版本与安装源
    Python 3.10.10支持PyTorch 2.0及以上版本,直接指定版本和官方包源安装:

    • 若使用CUDA 11.7:
      pip install torch==2.0.1+cu117 torchvision==0.15.2+cu117 torchaudio==2.0.2+cu117 --index-url https://download.pytorch.org/whl/cu117
    • 若仅使用CPU:
      pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cpu
  • 解决site-packages不可写问题
    若有管理员权限,右键以管理员身份打开命令提示符,再执行安装命令,即可绕过用户安装模式,直接安装到系统site-packages目录。

  • 验证版本匹配
    执行python --version确认当前Python版本为3.10.x,避免因版本不匹配导致的包查找失败。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.06.12 06:32:36