0

I'm having a massive amount of confusion about how pip and python work on RHEL7 / CentOS7. I earlier today ran into an issue where library versions were mismatching due to the python version that the Linux OS was using was different than the version which was required by the software I had just installed via yum (specifically this problem). After falling down a google rabbit hole I found this question, and eventually this question.

On my server I attempt to run pip without sudo and I get this error:

OSError: [Errno 13] Permission denied: '/usr/lib/python2.7/site-packages/boto'

Additionally, I run "whereis pip" and it tells me this:

pip: /usr/bin/pip /usr/bin/pip2.7 /usr/bin/pip3.4 /usr/bin/pip3.6

So I try to look in /usr/local/bin and try to find a pip or a python and it does not exist. I try to install pip or python and it tells me it's already installed. Essentially I am getting very lost and confused here, because I can't run pip without sudo, and I also can't run pip with sudo. What gives here!? Shouldn't I have a python and pip in /usr/local/bin that I need to always make sure is used when using pip?

Extra credit: What in the world is the difference between:

  • pip install docker-py
  • yum install python-docker-py
Ring
  • 2,249
  • 5
  • 27
  • 40
  • Instead of `sudo pip` have you tried running `sudo python -m pip`?. I've found that often simplifies environmental requirements. – FraggaMuffin Apr 27 '20 at 22:02
  • https://stackoverflow.com/search?q=%5Bpip%5D+OSError+Errno+13+Permission+denied – phd Apr 27 '20 at 22:27
  • "*Shouldn't I have a python and pip in `/usr/local/bin`*" No, why? – phd Apr 27 '20 at 22:28
  • "*What … is the difference between `pip install` and `yum install`?*" It's the difference between the system package manager that install precompiled packages with dependencies from OS repositories and Python package manager that installs from binary wheels and source packages from https://pypi.org – phd Apr 27 '20 at 22:30

0 Answers0