背景:在拿到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内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复