Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

me how to get complete python installed without breaking any programs - with python pip,

venv,
6/13/24, 6:25 PM and whatever else is needed.
apt - How to install Python 3.12 on Ubuntu 23.10? - Ask Ubuntu

Someone asked why do I need latest the python version. I just prefer it, but I want any Python 3 (I
prefer to use 3.9 and new always).

I did not install any Python. The only thing I did was sudo apt install python3-pip and also
python3-venv (and python3.11-venv), venvs failed to install but why does VSCode show 4
different Python interpreters now? I didn't install any python version. I installed Ubuntu 20.04
from an ISO file, and upgraded to 23.10. The default Python package on Ubuntu 23.10 is
python3.12.

Image of VSCode showing Python interpreters:

https://askubuntu.com/questions/1507661/how-to-install-python-3-12-on-ubuntu-23-10 1/3
Reading package lists... Done
Building dependency tree... Done
6/13/24, 6:25 PM
Reading state information... apt - How to install Python 3.12 on Ubuntu 23.10? - Ask Ubuntu
Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:


python3-venv : Depends: python3.11-venv (>= 3.11.2-1~) but it is not going to be
installed
Depends: python3 (= 3.11.2-1) but 3.11.4-5 is to be installed
E: Unable to correct problems, you have held broken packages.
ashish@ashish-pc:~$ ^C
ashish@ashish-pc:~$

I used sudo apt install python3-pip it worked and I got pip. Now when I tried sudo apt
install python3-venv it generated an error message. I just noticed that the python -m venv
command exists.

apt python pip

Share Edit Follow edited Mar 17 at 2:27 asked Mar 16 at 6:04


karel Ashish Agarwal
116k 114 281 313 41 1 6

Please specify why you need to have the latest Python, exactly what is it in there that you "must have". Edit
your question and add text there. -> docs.python.org/3/whatsnew/3.12.html – Hannu Mar 16 at 6:15

I'm sorry, I did it. I am new to stack overflow. – Ashish Agarwal Mar 16 at 6:37

1 Ubuntu relies on the Python version coming from the official sources, as parts of the system need it. This is
the Python version which is installed with sudo apt install python3 . This system should NEVER be
replaced with another Python release, as this may break your system up to being not usable anymore.

https://askubuntu.com/questions/1507661/how-to-install-python-3-12-on-ubuntu-23-10 2/3
Ubuntu packages all python3 packages separately. By installing python3-pip it also installed the
6/13/24, 6:25 PM apt - How to install Python 3.12 on Ubuntu 23.10? - Ask Ubuntu
base python3. If you want venv you also have to install it with
2
sudo apt install python3-virtualenv

Python2 and Python3 have major incompatible differences, but the python3 that ships with
Ubuntu will be maintained and you'll get the latest patches with an apt upgrade Ubuntu is stable
and updates are generally safe.

Share Edit Follow answered Mar 16 at 13:47


sleepyhead
588 2 6

1 Thanks! it worked for me. – Ashish Agarwal Mar 16 at 15:39

https://askubuntu.com/questions/1507661/how-to-install-python-3-12-on-ubuntu-23-10 3/3

You might also like