Score:0

ubuntu apt upgrade problem with py3compile not found after upgrading python3.9

ua flag

Ubuntu 20.04

When I tried to do sudo apt-get upgrade it gives me this error:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/230 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Setting up python3-apt (2.0.0ubuntu0.20.04.5) ...
/var/lib/dpkg/info/python3-apt.postinst: 6: py3compile: not found
dpkg: error processing package python3-apt (--configure):
 installed python3-apt package post-installation script subprocess returned error exit status 127
dpkg: error processing package python3-pip (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Setting up python3-minimal (3.8.2-0ubuntu2) ...
/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
Errors were encountered while processing:
 python3-apt
 python3-pip
 python3-minimal
E: Sub-process /usr/bin/dpkg returned an error code (1)

I tried sudo apt install -f --reinstall python3-minimal It didn't help and it returns:

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
Need to get 0 B/230 kB of archives.
After this operation, 0 B of additional disk space will be used.
E: Internal Error, No file name for python3-minimal:amd64

this error occurred after i tried to upgrade python3.9

I'm new with ubuntu so I will be glad for some help with that.

user535733 avatar
cn flag
Advice: Revert back to Python3.8. Changing Python versions will break your system terribly. You can have more than one version of Python3 installed, *but not by using deb packages and apt*.
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.