I'm trying to install python3 (and python2) in my env but I keep on getting the following issue:
sudo apt-get install python3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3 is already the newest version (3.10.6-1~22.04).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python3-minimal (3.10.6-1~22.04) ...
/var/lib/dpkg/info/python3-minimal.postinst: 5: py3compile: not found
dpkg: error processing package python3-minimal (--configure):
installed python3-minimal package post-installation script subprocess returned error exit status 127
Setting up language-selector-gnome (0.219) ...
/var/lib/dpkg/info/language-selector-gnome.postinst: 6: py3compile: not found
dpkg: error processing package language-selector-gnome (--configure):
installed language-selector-gnome package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
python3-minimal
language-selector-gnome
E: Sub-process /usr/bin/dpkg returned an error code (1)
I tried to fix the issue in different ways but I keep getting the same issue each time.
Thanks for any help.
edit:
I ran the command
sudo apt remove python3
tried to remove python3 and I get the following erroes:
The following NEW packages will be installed:
libqt5gui5-gles libqt5quick5-gles
0 upgraded, 2 newly installed, 217 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/5,427 kB of archives.
After this operation, 276 MB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 261970 files and directories currently installed.)
Removing language-selector-gnome (0.219) ...
/var/lib/dpkg/info/language-selector-gnome.prerm: 6: py3clean: not found
dpkg: error processing package language-selector-gnome (--remove):
installed language-selector-gnome package pre-removal script subprocess returne
d error exit status 127
/var/lib/dpkg/info/language-selector-gnome.postinst: 6: py3compile: not found
dpkg: error while cleaning up:
installed language-selector-gnome package post-installation script subprocess r
eturned error exit status 127
Removing python3-commandnotfound (22.04.0) ...
/var/lib/dpkg/info/python3-commandnotfound.prerm: 6: py3clean: not found
dpkg: error processing package python3-commandnotfound (--remove):
installed python3-commandnotfound package pre-removal script subprocess returne
d error exit status 127
dpkg: too many errors, stopping
Errors were encountered while processing:
language-selector-gnome
python3-commandnotfound
Processing was halted because there were too many errors.
E: Sub-process /usr/bin/dpkg returned an error code (1)
edit 2:
tried to install python3.10-minimal by:
sudo apt-get install python3.10-minimal
and got the following errors:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
python3.10-minimal is already the newest version (3.10.6-1~22.04.2).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up python3-commandnotfound (22.04.0) ...
/var/lib/dpkg/info/python3-commandnotfound.postinst: 6: py3compile: not found
dpkg: error processing package python3-commandnotfound (--configure):
installed python3-commandnotfound package post-installation script subprocess returned error exit status 127
Setting up python3-minimal (3.10.6-1~22.04) ...
/var/lib/dpkg/info/python3-minimal.postinst: 5: py3compile: not found
dpkg: error processing package python3-minimal (--configure):
installed python3-minimal package post-installation script subprocess returned error exit status 127
Setting up language-selector-gnome (0.219) ...
/var/lib/dpkg/info/language-selector-gnome.postinst: 6: py3compile: not found
dpkg: error processing package language-selector-gnome (--configure):
installed language-selector-gnome package post-installation script subprocess returned error exit status 127
Errors were encountered while processing:
python3-commandnotfound
python3-minimal
language-selector-gnome
E: Sub-process /usr/bin/dpkg returned an error code (1)