Update python to v3.9

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?



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

Raspbian GNU/Linux 9 \n \l

Yes this is Debian Stretch. There latest Python version available via apt package is 3.5

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?

switch to Debian Buster :wink:

Hm… I am running dietpi v6.33.3
How to update that one?


DietPi are juts scripts on top of a Debian base image and there is no relation between the underlying OS version and DietPi version :wink: . 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 https://dietpi.com/forum/t/qbittorrent-version-shipping-with-dietpi/2326/9

Before trying to perform an upgrade, clone your SD card to be on save side !