我正在使用运行Linux机器的EC2实例。错误地,我删除了Python
sudo rm -r /usr/lib/python
sudo rm -r /usr/lib/python27
然后,我尝试从/ usr / bin / python
中复制回来恢复Python sudo cp-r /usr/bin/python /usr/lib/python
sudo cp-r /usr/bin/python27 /usr/lib/python27
现在,我正在努力解决这个错误。每当我运行任何yum命令时,例如
yum --version
There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum.
当我尝试获取Python版本时,它显示已经安装了Python。
[ec2-user@ip-172-31-10-195 ~]$ python -V
Python 2.7.12
[ec2-user@ip-172-31-10-195 ~]$ /usr/bin/python -V
Python 2.7.12
[ec2-user@ip-172-31-10-195 ~]$
答案 0 :(得分:0)
使用rpm,C程序,找出你需要重新安装的rpms,下载并重新安装它们