Update python to v3.9

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
dietpiOK
Posts: 84
Joined: Thu Mar 16, 2017 9:33 am

Update python to v3.9

Post by dietpiOK »

Hi!
How can I update python to version 3.9? I tried to run "apt-get install python3.9" but the command "python3 -V" still points to version 3.5.
Furthermore "apt list --installed" does not show the 3.9 version.

Any idea?

Regards,
Olaf
User avatar
Joulinar
Posts: 3263
Joined: Sat Nov 16, 2019 12:49 am

Re: Update python to v3.9

Post by Joulinar »

Hi,

the Python version depends on the Debian version you are running. Looks like you are running Debian Stretch if you are on Pythong 3.5 https://packages.debian.org/search?keywords=python3

can you check following cat /etc/issue
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
dietpiOK
Posts: 84
Joined: Thu Mar 16, 2017 9:33 am

Re: Update python to v3.9

Post by dietpiOK »

Raspbian GNU/Linux 9 \n \l
User avatar
Joulinar
Posts: 3263
Joined: Sat Nov 16, 2019 12:49 am

Re: Update python to v3.9

Post by Joulinar »

Yes this is Debian Stretch. There latest Python version available via apt package is 3.5
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
dietpiOK
Posts: 84
Joined: Thu Mar 16, 2017 9:33 am

Re: Update python to v3.9

Post by dietpiOK »

When running a script I get the following notice:

DEPRECATION: Python 3.5 reached the end of its life on September 13th, 2020. Please upgrade your Python as Python 3.5 is no longer maintained. pip 21.0 will drop support for Python 3.5 in January 2021. pip 21.0 will remove support for this functionality.


So what is the best way to get back into a supported environment?
User avatar
Joulinar
Posts: 3263
Joined: Sat Nov 16, 2019 12:49 am

Re: Update python to v3.9

Post by Joulinar »

switch to Debian Buster ;)
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
dietpiOK
Posts: 84
Joined: Thu Mar 16, 2017 9:33 am

Re: Update python to v3.9

Post by dietpiOK »

Hm... I am running dietpi v6.33.3
How to update that one?
User avatar
Joulinar
Posts: 3263
Joined: Sat Nov 16, 2019 12:49 am

Re: Update python to v3.9

Post by Joulinar »

Hi,

DietPi are juts scripts on top of a Debian base image and there is no relation between the underlying OS version and DietPi version ;) . In your case Raspberry OS is used as base image. Officially DietPi did not support Debian version updates but you might have a look into following link viewtopic.php?p=18988#p18988

Before trying to perform an upgrade, clone your SD card to be on save side !
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply