This article mainly introduces to you because the Python upgrade causes Yum, pip Error Resolution method, the article through the sample code to solve the method introduced in very detailed, to everyone's study or work has a certain reference learning value, the need for friends below with the small series to learn to study under.
Objective
This article mainly introduces to you because of the Python upgrade lead to Yum, pip error of the liberation method, share out for everyone to reference the study, the following words do not say more, come together to see the detailed introduction bar.
Reason:
Yum is written in Python. The Python version on the server is too low to upgrade to 2.7, and YUM/PIP is not upgraded, resulting in the error of executing the YUM/PIP times.
Yum Error:
There is a problem importing one of the Python modulesrequired to run yum. The error leading to this problem Was:no module named Yumplease Install a package which provides this module, orverify th At the module is installed correctly. It's possible that the above module doesn ' t match thecurrent version of Python, which is:2.7.10 (default, Sep 5 2017, 17:3 5:43) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]if You cannot solve this problem yourself, click Go to the Yum FAQ at:http:/ /yum.baseurl.org/wiki/faq
PIP Error:
Traceback (most recent): File "/usr/bin/pip2", line 5, in <module> from pkg_resources import Load_entry_po Intimporterror:no module named Pkg_resources
Solution:
1. View the Python version and execute:
which Python
You can see that there are two versions of Python.
2. To view yum files, execute:
Vim/usr/bin/yum
You can see the Python reference for Yum on the first line of the file. Change the original #!/usr/bin/python to #!/usr/bin/python2.6 (old version)
3. Run out of Yum again and you can use it.
Pip similarly modified