Fixed with compiling python from source + adding the usr/local/bin to PATH and updating alternatives for python.
Answer from MIku on askubuntu.comInstall python 3.11.9 on ubuntu
add python 3.10 on ubuntu - Stack Overflow
Installing Python 3.10
Upgrading Python 3.8 to 3.10 or higher on an older Ubuntu
Videos
I'm also using the deadsnakes PPA. Every version is installed separately, so you can switch versions on the fly. So to use any version installed from deadsnakes, you have to call it explicitely.
Copy$ python3.10 --version
Python 3.10.4
You have to use update-alternatives, following such approach https://linuxconfig.org/how-to-change-from-default-to-alternative-python-version-on-debian-linux
You'll be able to choose more conveniently which python version you want to use.
Hi there,
I am working with a docker image created from ubuntu:20.04 base image.
At the moment we are installing python like this in the Dockerfile:
RUN apt-get install -y --no-install-recommends \ python3-dev \ python3-pip \ python3-venv \
The problem with this is that it installs Python v3.8. I need to install v3.10 and when I change the above command to install python3.10-dev, python3.10-pip and python3.10-venv - docker build fails saying:
#17 85.42 E: Unable to locate package python3.10-dev 17 85.42 E: Couldn't find any package by glob 'python3.10-dev' 17 85.42 E: Couldn't find any package by regex 'python3.10-dev' 17 85.42 E: Unable to locate package python3.10-venv 17 85.42 E: Couldn't find any package by glob 'python3.10-venv' 17 85.42 E: Couldn't find any package by regex 'python3.10-venv'
I have read online to add ppa:deadsnakes/ppa repo as a solution. But I am not sure if its safe to do so especially when there might be some corporate creds being accessed using the container.
Is there any other safe way to install python3.10 and other optional stuff?
Thanks