This is not a duplicate because the suggested article references a general question. My question refers to how do you fix paths after two versions are installed.
Im working in RHEL 7 and accidentally installed Python2.7 on top of Python3.5... long story, it happened. I need to use 2.7 for my scripts. I tried creating a sym link and that works, but yum is still not working. Also, if I install anything with pip, it's putting it into /usr/local/lib/python3.5/site-packages. Suggestions how to fix this? I've been googling for hours and I'm pulling my hair out. Thank you in advance.
pip version:
# pip --version
pip 8.0.2 from /usr/local/lib/python3.5/site-packages (python 3.5)
created link to 2.7 version:
# ln -s /usr/local/bin/python2.7 /usr/bin/python
python location:
# which python
/usr/bin/python
check version:
# python
Python 2.7.11 (default, Mar 3 2016, 08:44:22)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>quit()
tried to use yum:
# yum update
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
Please install a package which provides this module, or
verify that the module is installed correctly.
It's possible that the above module doesn't match the
current version of Python, which is:
2.7.11 (default, Mar 3 2016, 08:44:22)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
pip version has not changed after uninstalling/reinstalling
# pip --version
pip 8.0.2 from /usr/local/lib/python3.5/site-packages (python 3.5)