如果你在错误的时间错误的地点做了一件错误的事,没错我说的是你把yum或python卸载了,表慌!

    1.彻底删除python

    1. rpm -qa|grep python|xargs rpm -e --allmatches --nodeps
    2. whereis python|xargs rm -fr

    2.彻底删除yum

    1. rpm -qa|grep yum|xargs rpm -e --allmatches --nodeps
    2. whereis yum|xargs rm -fr

    3.开始安装:

    1. # 创建python和yum的安装路径
    2. mkdir -pv ./{python,yum}
    3. # 将python和yum对应的包放入文件夹
    4. cd python
    5. rpm -ivh python-* rpm-* --nodeps --force
    6. cd yum
    7. rpm -ivh yum-* --nodeps --force
    8. # 安装setuptools
    9. tar zxvf setuptools-25.0.0.tar.gz
    10. cd setuptools-25.0.0
    11. python setup.py build
    12. python setup.py install
    13. # 安装pip
    14. cd /opt
    15. tar zxvf pip-10.0.1.tar.gz
    16. cd pip-10.0.1
    17. python setup.py build
    18. python setup.py install
    19. # 安装requests模块
    20. pip install requests

    原文链接:https://blog.csdn.net/weixin_40668374/article/details/109199683