我是靠谱客的博主 健壮战斗机,最近开发中收集的这篇文章主要介绍在ubuntu16.04中输入不存在shell命令时,报错ModuleNotFoundError的解决方案,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
背景:在拿到ubuntu机器后,我在系统上安装了python的3.7版本,在安装过程中删除了一个lsb_release.py文件,之后我的shell命令就使用异常了。
报错触发原因
当我输入ubuntu无法识别的命令的时候,正常来说应该提示类似于 command not found
之类的字眼,但是系统确报了如下错误:
报错详情:
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'
解决方案:
sudo apt-get remove --purge python3*
sudo apt auto remove
参考链接:https://askubuntu.com/questions/766246/missing-package-commandnotfound
总结:在删除系统的东西前先思考一下,千万别手贱!!!
最后
以上就是健壮战斗机为你收集整理的在ubuntu16.04中输入不存在shell命令时,报错ModuleNotFoundError的解决方案的全部内容,希望文章能够帮你解决在ubuntu16.04中输入不存在shell命令时,报错ModuleNotFoundError的解决方案所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复