简体   繁体   中英

How to make python 3.7 default in Ubuntu 20.04?

I would like to install tensorrt binding for python3 on Ubuntu 20.04 ( https://docs.nvidia.com/deeplearning/tensorrt/archives/tensorrt-700/tensorrt-install-guide/index.html#installing-debian ). This Ubuntu has python 3.8 as a default, but those tensorrt bindings needs python 3.7 or lower.

The package is installed via sudo apt-get install python3-libnvinfer-dev . But this crash because of python 3.8. So I have installed also python 3.7 via sudo apt-get install python3.7 so I can access 3.7 running command python3.7. I have also made a ln -s /usr/bin/python3.7 /usr/bin/python3 to make a python3 command opennning the 3.7 version. But aptget still has a problem and python3.7 is not visible for it. What can I do to make python 3.7 native in Ubuntu 20.04 or how to tell apt-get to look in /usr/bin/python3.7 location? Thanks

Check if http://web.mit.edu/6.00/www/handouts/pybuntu.html helps. unbuntu seems to ahvve update-alternative Didn't try it myself.

This should solve your problem. But i don't know how to make python3.7 the default in Ubuntu 20.04.

Download the tar file install package of your desired TensorRT version. Extract it. Navigate to the extracted folder and then to the python folder. You will find the .whl files for the TensorRT python API. Try installing with pip.

In your case it should be like this(if you are trying to install TensorRT 7.1):

python3.7 -m pip install tensorrt-7.1.3.4-cp37-none-linux_x86_64.whl

I found this procedure from the official TensorRT github repository

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM