I have a server running RHEL 6 with Python 2.6.6. I am having trouble using pip with Python as a non-root user.
I am able to install pip packages and use them as root. However, when I try to run pip as a non-root user, I get this error:
[~]$ pip install requests
Traceback (most recent call last):
File "/usr/bin/pip", line 7, in <module>
from pip import main
ImportError: No module named pip
Likewise, while I can use requests
for example after installing as root, I cannot then use it as a non-root user.
[~]$ python
Python 2.6.6 (r266:84292, May 22 2015, 08:34:51)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-15)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import requests
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named requests
>>>
I am running pip 8.1.1:
[~]# pip --version
pip 8.1.1 from /usr/lib/python2.6/site-packages (python 2.6)
rpm -qf $(which python)
as both your user and root? – carlwgeorge May 29 '17 at 17:12