Score:0

ModuleNotFoundError: No module named 'CommandNotFound'

gb flag

I manually installed python3.8.5 on my Ubuntu laptop after I accidentally deleted it from /usr/bin. I have successfully linked my python python3 and pip3 to my computer so when I type which <either python, python3, or pip3> it gives a path and when I type them alone I get the shell.

For example,

jayakumar@jayakumarUbuntu:~/Downloads$ pip3 install pygame
Defaulting to user installation because normal site-packages is not writeable
Collecting pygame
  Downloading pygame-2.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (21.8 MB)
     |████████████████████████████████| 21.8 MB 17.1 MB/s 
Installing collected packages: pygame
Successfully installed pygame-2.1.2

*just to show it's working

my ubuntu applications and some other apps (vscode, android studio, etc.) are not launching and any ways to fix it without reinstalling my desktop would be nice thanks.

When I run them from the terminal:

Traceback (most recent call last):
  File "/usr/lib/command-not-found", line 27, in <module>
    from CommandNotFound.util import crash_guard
ModuleNotFoundError: No module named 'CommandNotFound'
kanehekili avatar
zw flag
Yup, you've removed an integral part of you operating system. Ubuntu relies on its version of python and its tool collection. There are >100 questions in this forum about problems after installing another python version... You might try to reinstall the original Ubuntu python files.
David avatar
cn flag
Or save yourself a lot of time and grief and reinstall the OS. Basically you ripped out the heart of the system.
PythonCoder123 avatar
gb flag
@David Is that the only possible way? I do not have a 256 gb usb to back up my data in case something goes wrong.
David avatar
cn flag
You might after struggling and trying various fixes over many weeks get it working. Or in a couple of hours have a working system. Never mess with the default python.
I sit in a Tesla and translated this thread with Ai:

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.