I'm running Ubuntu 15.10. I installed Pyhon 2.7 through aptitude:
sudo apt-get install python
now I'm trying to install pip using this guide. I downloaded get-pip.py
, then I tried:
sudo python get-pip.py
Installation worked fine, but I got these annoying warnings:
The directory '/home/administrator/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/administrator/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
So I uninstalled all by the following command:
sudo python -m pip uninstall pip setuptools
And I tried a new installation without sudo
:
python get-pip.py
but I got the following error:
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pip'
How can I install pip (and wheels) in a proper way with caching enabled?
python
before installation I got an error (I don't remember a message byapt-get
similar to what you have just cited). It seemed that python interpreter was not present. Aftersudo apt-get install python
all worked fine... According to you do not I need to uninstall python (installed bysudo apt-get install python
)? So if I installpip
throughapt-get
and later I upgrade, I get the same version ofpip
that I would have got through pip? Thanks a lot! – floatingpurr Mar 11 '16 at 00:38sudo apt-get remove python
!!! Although you say thatpython
wasn't installed before, this almost can't be true without having caused severe malfunctions of many programs. You are not supposed to remove neither thepython
package (Python 2.7) nor thepython3
package (Python 3.4). – Byte Commander Mar 11 '16 at 07:14virtualenv
with its own python interpreter and its packages to create a dedicated/isolated development environment? – floatingpurr Mar 11 '16 at 10:31python
for the very first time, I got: `The program 'python' can be found in the following packages:Try: sudo apt-get install`
That's the reason why I installed an interpreter : )
– floatingpurr Mar 11 '16 at 11:41sudo -H
fix permissions problems on directories like/home/administrator/.cache/
... – floatingpurr Mar 11 '16 at 12:43sudo -H
runs the command as root, but sets the used home directory to root's home directory/root
instead of the user's home directory/home/YOUR_USERNAME
as normalsudo
would do. The warning is generated bypip
because it does not want to generate cache files in your home directory as root which you yourself could not access as normal user. – Byte Commander Mar 11 '16 at 13:00