Score:4

what is the best way to install python 3.10.10 (which is the current version of 3.10) on a 22.04 machine where the systems python version is 3.10.6

sy flag

I have done the following on a clean install of a 22.04 machine:

sudo apt update
sudo apt upgrade
sudo apt autoremove
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt install python3.10
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3.10 is already the newest version (3.10.6-1~22.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

as one can see it's happy with the system version which is 3.10.6

without installing anaconda (which installs a BUNCH of stuff I don't need on the server)... what are my options so that I can detach people from the system version, which is not up to date? I thought the point of adding deadsnakes was in part a way to resolve this, and/or installing prior versions.

also, I wanted to understand what is the recommended way of setting up the machine so that people using the machine are not using the system python and using a slightly different version of python. (eg: subversion differences like stated above)

to be clear I do not want to change the systems version of python. I only want to change what the users... um... use. ;-)

I would like to use 3.10.10 for the bug fixes, I am assuming that 3.10.6 is the last security patch. I should also note that for an 18.04 machine we were ending up with 3.10.10 when we had it apt upgrade.

thus, 18.04 machines that are going through the do-release-upgrade to 22.04 end up with the following state:

python3
Python 3.10.10 (main, Feb  8 2023, 14:49:42) [GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
which python3
/usr/bin/python3

thus the clean install 22.04 machines are behind any of the 18.04's upgraded to 22.04.

one other item of note is 3.10.7, 3.10.8, and 3.10.9 are security patches... so I am wondering why the system patch is not at least at 3.10.9. see the python release notes for further details.

Artur Meinild avatar
vn flag
Please explain *why* you want 3.10.10 - the Python 3.10 version of Ubuntu is properly patched with security updates, so is there any reason why, except *"you would like the latest"*?
boar avatar
sy flag
I added rational as to why, and noting that I do not want to change the system python. also see comments about upgraded 18.04 machines.
Score:4
pl flag

The deadsnakes ppa does not contain 3.10 for Jammy (22.04). So it's working as designed, telling you that there's no 3.10 other than the one you have installed. There is 3.11 and 3.12 for Jammy. But I certainly wouldn't replace the system python with those.

You may want to consider using virtualenv's to isolate your work for different python versions.

enter image description here

pl flag
Another way to do it is with containers. With LXD you could spin up a container, and put a bespoke python version in it, and share the credentials for the container with your user. Each user could potentially have their own isolated container.
ru flag
And yet another way to do this is to install the python version you want in userspace (after installing all the build dependencies from the repositories) with `pyenv` and then just create a venv around the userspace python you want to use. If you don't want to use the PPA that is.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.