卸载 TensorRT#

当使用 Python 包索引安装 TensorRT 时,您必须显式删除 Python 模块依赖项才能卸载它。对于 CUDA 12.x 安装,请使用以下示例命令删除所有 TensorRT Python 模块。

python3 -m pip uninstall tensorrt tensorrt-cu12 tensorrt-cu12-bindings tensorrt-cu12-libs

要使用 tar 文件卸载 TensorRT,请删除解压后的文件并将 LD_LIBRARY_PATH 重置为其原始值。

要使用 zip 文件卸载 TensorRT,请删除解压后的文件并从 PATH 环境变量中删除新添加的路径。

当使用 tar 或 zip 文件安装 Python TensorRT wheel 文件时,请使用以下命令卸载它们。

sudo python3 -m pip uninstall tensorrt
sudo python3 -m pip uninstall tensorrt_lean
sudo python3 -m pip uninstall tensorrt_dispatch

要使用 Debian 或 RPM 包卸载 TensorRT,请卸载 libnvinfer10 和其他相关包。

sudo apt-get purge "libnvinfer*"
sudo apt-get purge "nv-tensorrt-local-repo*"

sudo yum erase "libnvinfer*"
sudo yum erase "nv-tensorrt-local-repo*"