Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 14038  / 2 Years ago, sat, july 23, 2022, 4:32:24

when I opened terminal and $ pip install -U pip setuptools, I got an error message.



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'


I use python3.5, and its path is /usr/bin/python3.5



I tried to find CommandNotFound package but I can't find it.



How can I fix this error?






[edit] : OS Ubuntu 16.04.3 LTS


More From » python

 Answers
7

Link



Solution: Unlike I mentioned before my python3.5.1 installation was not removed by the update. It was still under /usr/local/bin/python3.5.



Tracing the Error: I wrote a few debug lines into /usr/lib/python3.5/_sysconfigdata.py:



print("python-version", sys.version_info)
print("python-gcc-version",sys.version)
print("python-executable",sys.executable)


The output was different between calling /usr/bin/python3 and rhythmbox, but the python-executable was in both ways /usr/bin/python3



When I searched for the wrong installation using where is python3 and
removed



/usr/local/bin/python3.5


Then I purged and reinstalled python3 and ran apt install -f.
So this Error disappeared.



Remember: never install stuff from source, if it might be in the repos sometime or, at least remove it before your package manager installs it.


[#10385] Monday, July 25, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
neasinient

Total Points: 491
Total Questions: 120
Total Answers: 93

Location: The Bahamas
Member since Mon, Aug 2, 2021
3 Years ago
;