Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redhat trying to use pip ImportError: No module named pip

Tags:

python

pip

redhat

I am trying to use pip on my Redhat system.

I installed pip following the instructions here, but when I try to use it, for example pip install, I get the following error code:

Traceback (most recent call last):
  File "/usr/local/bin/pip", line 7, in ?
    from pip import main
ImportError: No module named pip
like image 464
Mark5907 Avatar asked Nov 11 '22 05:11

Mark5907


1 Answers

this issue due to common user do not have privilege to access packages py file.
1. root user can run 'pip list'
2. other common user cannot run 'pip list'

[~]$ pip list
Traceback (most recent call last):
  File "/usr/bin/pip", line 7, in <module>
    from pip._internal import main
ImportError: No module named pip._internal

solution : root user login and run

chmod -R 755 /usr/lib/python2.7

fix this issue.

like image 173
Yi Yang Apollo Avatar answered Nov 14 '22 22:11

Yi Yang Apollo