I'm using SCL to manage different versions of Python on a machine, but I'm having trouble updating and installing packages at the SCL level.
I am trying to upgrade pip. First I tried
scl enable python27 'pip install -U pip'
but I do not have permissions to touch the SCL python site-packages.
Then I run
sudo scl enable python27 'pip install -U pip'
this completes successfully. However, this happens:
$ scl enable python27 pip --version
Traceback (most recent call last):
File "/opt/rh/python27/root/usr/bin/pip", line 7, in <module>
from pip import main
ImportError: No module named pip.
$ sudo scl enable python27 pip --version
works, however.
Upon further inspection, it looked like the site-packages/pip
directory was created with the wrong permissions.
What is the recommended way to manage parts of an SCL install that require root?