Could not find a version that satisfies the requirement torch>=1.8.1 (from stable_baselines3) (from versions: 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.3.0, 1.3.1, 1.4.0)
No matching distribution found for torch>=1.8.1 (from stable_baselines3)

可能的原因

1.源中版本有限

你所使用的 PyPI 源可能没有提供 PyTorch 1.8.1 及以上版本。

2.Python 版本不兼容

某些 PyTorch 版本可能不支持你当前使用的 Python 版本。

解决办法

1. 使用 PyTorch 官方源

PyTorch 官方提供了专门的包索引,你可以从官方源安装 PyTorch。根据你的 CUDA 版本和 Python 版本,选择合适的安装命令。

这里以CUDA 12.1 版本为例:

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121

CPU 版本

pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
2. 检查 Python 版本

确保你使用的 Python 版本与 PyTorch 兼容。PyTorch 通常支持 Python 3.7 及以上版本。你可以通过以下命令查看 Python 版本

python --version

 

如果 Python 版本过低,建议升级到 Python 3.7 或更高版本。

Logo

有“AI”的1024 = 2048,欢迎大家加入2048 AI社区

更多推荐