Unable to install python3-libnvinfer package, unmet dependencies

4.7k Views Asked by At

I'm trying to install python3-libnvinfer-dev for TensorRT (Tensorflow). I have Ubuntu 22.04 with python 3.10.4 but I use Anaconda's python 3.9.7. I have Nvidia 510 drivers, CUDA 11.6 and Cudnn 8. The issue is, when I run sudo apt-get install python3-libnvinfer-dev it shows this error:

The following packages have unmet dependencies: python3-libnvinfer : Depends: python3 (< 3.9) but 3.10.4-0ubuntu2 is to be installed E: Unable to correct problems, you have held broken packages.

What can I do to fix this?

1

There are 1 best solutions below

0
On

Root cause: The error message says that the package requires you to have python < 3.9 but you told you have Python 3.9.7 in your Anaconda.

Solution 1

Downgrade your Python to 3.8 in your Anaconda.

Solution 2

If you want to try to fix the conflict in apt you should run this command

sudo aptitude install python3-libnvinfer-dev

Then follow the instructions in the prompts. The tool tries to offer you different alternatives how to resolve the conflicts between the packages.

Solution 3

This is not probably what you want but if you install the package on your system without Anaconda it should work as you are using Python 3.10

As a curiosity, I was able to install the latest python3-libnvinfer-dev for TensorRT 8.4.1 on Ubuntu 20.04 with Python 3.8.10 and CUDA 11.6.