I have made a new, fresh installation of Ubuntu 22.04, on which I have also run sudo apt update and sudo apt upgrade.
Now I am trying to create a Python virtual env, but run into dependency issues, which I haven't been able to resolve. Running python3 -m venv myvenv
asks me to run apt install python3.10-venv
Doing so (with sudo, of course) I get this error:
Reading package lists... Done
Building dependency tree... Done
Reading state information... 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.10-venv : Depends: python3.10 (= 3.10.4-3ubuntu0.1) but 3.10.6-1~22.04 is to be installed
Depends: python3.10-distutils
E: Unable to correct problems, you have held broken packages.
I have also tried sudo apt install python3-venv
but that has similar problems with dependencies:
The following packages have unmet dependencies:
python3-venv : Depends: python3.10-venv (>= 3.10.4-1~) but it is not going to be installed
Depends: python3 (= 3.10.4-0ubuntu2) but 3.10.6-1~22.04 is to be installed
Depends: python3-distutils (>= 3.9.10-2~) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
I have also tried to install pip, running sudo apt install python3-pip
and get this conflict:
The following packages have unmet dependencies:
python3-distutils : Depends: python3-lib2to3 (= 3.10.4-0ubuntu1) but 3.10.6-1~22.04 is to be installed
E: Unable to correct problems, you have held broken packages.
How can I get around these problems?
EDIT
As requested:
$ apt-cache policy python3.10-venv:
python3.10-venv:
Installed: (none)
Candidate: 3.10.4-3ubuntu0.1
Version table:
3.10.4-3ubuntu0.1 500
500 http://archive.ubuntu.com/ubuntu jammy-security/universe amd64 Packages
3.10.4-3 500
500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages