定位和解决 pip install onnxruntime-gpu
报错,无法安装的问题
报错信息如下:
ERROR: Could not find a version that satisfies the requirement onnxruntime-gpu (from versions: none)
ERROR: No matching distribution found for onnxruntime-gpu
先说结论:
原因是 python 版本太高了,重新创建一个稍低版本(python 3.10)的虚拟环境即可, 如下。
conda create --name alan_ai python=3.10
# 再执行:
pip install onnxruntime-gpu --extra-index-url https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/onnxruntime-cuda-12/pypi/simple/
我之前是 conda create --name alan_ai python=3
安装的,默认给我装的 3.12