
安装 torch-tensorrt 报错
问题:
安装 torch-tensorrt 时遇到错误,提示「该软件包仅是 pypi.org 存储库上的占位符项目。要安装 torch-tensorrt,请运行以下命令: pip install torch-tensorrt -f https://github.com/nvidia/torch-tensorrt/releases」。
原因:
pypi 上上传的 torch-tensorrt 是无法使用的占位符项目。因此,pip 无法从 pypi 仓库中下载 torch-tensorrt。
解决方案:
绕过 pypi 源:
-
使用 -f 参数指定正确的下载源,例如:
pip install torch-tensorrt -f https://github.com/nvidia/torch-tensorrt/releases
手动下载 wheel 文件:
- 从 github 发布页面下载相应的 wheel 文件:https://github.com/nvidia/torch-tensorrt
-
将 wheel 文件下载到本地,然后使用 pip 命令手动安装:
pip install torch-tensorrt-x.y.z-py3-none-any.whl
(其中 x.y.z 为 wheel 文件的版本号)
更换下载源:










