I am trying to install the TensorRT 7.1 on Ubuntu18.04 for pytorch 1.15 according to debian install guide but it reported this error.
Error:
The following packages have unmet dependencies:
tensorrt : Depends: libnvinfer7 (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvinfer-plugin7 (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvparsers7 (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvonnxparsers7 (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvinfer-bin (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvinfer-dev (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvinfer-plugin-dev (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvparsers-dev (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvonnxparsers-dev (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvinfer-samples (= 7.1.3-1+cuda10.2) but it is not going to be installed
Depends: libnvinfer-doc (= 7.1.3-1+cuda10.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
Hi. Thanks for the reply. I tried all of your recommended ways but it couldn’t fix my issue. After searching for a solution all over the place, I tried uninstalling cuda, cudnn and reinstall all of it from scratch by using debian because at first cuda-10-2 was installed by using run file instead of debian. Luckily, this time I can install the TensorRT without no issue or whatsover.
~dpkg -l | grep TensorRT
ii libnvinfer-bin 7.1.3-1+cuda10.2 amd64 TensorRT binaries
ii libnvinfer-dev 7.1.3-1+cuda10.2 amd64 TensorRT development libraries and headers
ii libnvinfer-doc 7.1.3-1+cuda10.2 all TensorRT documentation
ii libnvinfer-plugin-dev 7.1.3-1+cuda10.2 amd64 TensorRT plugin libraries
ii libnvinfer-plugin7 7.1.3-1+cuda10.2 amd64 TensorRT plugin libraries
ii libnvinfer-samples 7.1.3-1+cuda10.2 all TensorRT samples
ii libnvinfer7 7.1.3-1+cuda10.2 amd64 TensorRT runtime libraries
ii libnvonnxparsers-dev 7.1.3-1+cuda10.2 amd64 TensorRT ONNX libraries
ii libnvonnxparsers7 7.1.3-1+cuda10.2 amd64 TensorRT ONNX libraries
ii libnvparsers-dev 7.1.3-1+cuda10.2 amd64 TensorRT parsers libraries
ii libnvparsers7 7.1.3-1+cuda10.2 amd64 TensorRT parsers libraries
ii python3-libnvinfer 7.1.3-1+cuda10.2 amd64 Python 3 bindings for TensorRT
ii python3-libnvinfer-dev 7.1.3-1+cuda10.2 amd64 Python 3 development package for TensorRT
ii tensorrt 7.1.3.4-1+cuda10.2 amd64 Meta package of TensorRT
However, there comes another problem. Since I was using anaconda environments, I can’t import tensorrt from any of conda environments.
Python 3.7.4 (default, Aug 13 2019, 20:35:49)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorrt
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tensorrt'
Is there anyway to install tensorrt to a specific conda environment?
Hi,
Can you pls check if tensorrt is installed in your conda environment python and not on the system python.
You can refer to the below links for details -
Hi,
Thanks for the reply again. Since the installation of tensorrt was done by using deb file, I couldn’t import the tensorrt from any of the conda environments. Just like the first post, I switched to system python instead of any of the conda environments and then I was successfully able to import the tensorrt in system python. But is there any way to install tensorrt to anaconda environments? I don’t want to touch system python for some reasons.
Maybe you can reference step 2 (it’s jetson platform)
This needs to be done because the python bindings to tensorrt are available in dist-packages and this folder is usually not visible to your virtualenv. To make them visible we add it to PYTHONPATH .
@vermillionblu Sorry for the late reply. As far as I remember, I re-installed CUDA 10.2 by using deb file and then installed the TensorRT as mentioned in the Installation guide. Then I exported path of base python packages in source file.