Python 3.8 is default python in Ubuntu 20. But some libraries don’t support this version. For this we must install lowest versions and set them default. Easiest way is that using APT.

# sudo add-apt-repository ppa:deadsnakes/ppa
# sudo apt-get update
# sudo apt-get install python3.7

You can install Python 3.6, 3.5 etc… But you can’t set “alternatives” for python. You have to set Python 3.7 as default yourself. Let me explain why. Default python executable is located to /usr/bin/python and this linked to /usr/bin/python3 This file linked to /usr/bin/python3.8 This file is real executable file. For this you must delete /usr/bin/python3 and create a soft link to /usr/bin/python3.7 Then you can access Python 3.7 via python command.

# rm /usr/bin/python3
# ln -s /usr/bin/python3.7 /usr/bin/python3
# python --version
Python 3.7.6

You can ask your questions in comments or you can send e-mail to us: [email protected]

Source: https://stackoverflow.com/questions/61430166/python-3-7-on-ubuntu-20-04

 


0 yorum

Bir cevap yazın

E-posta hesabınız yayımlanmayacak. Gerekli alanlar * ile işaretlenmişlerdir

This site uses Akismet to reduce spam. Learn how your comment data is processed.