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?
pythonbefore installation I got an error (I don't remember a message byapt-getsimilar to what you have just cited). It seemed that python interpreter was not present. Aftersudo apt-get install pythonall worked fine... According to you do not I need to uninstall python (installed bysudo apt-get install python)? So if I installpipthroughapt-getand later I upgrade, I get the same version ofpipthat I would have got through pip? Thanks a lot! – floatingpurr Mar 11 '16 at 00:38sudo apt-get remove python!!! Although you say thatpythonwasn't installed before, this almost can't be true without having caused severe malfunctions of many programs. You are not supposed to remove neither thepythonpackage (Python 2.7) nor thepython3package (Python 3.4). – Byte Commander Mar 11 '16 at 07:14virtualenvwith its own python interpreter and its packages to create a dedicated/isolated development environment? – floatingpurr Mar 11 '16 at 10:31pythonfor 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 -Hfix permissions problems on directories like/home/administrator/.cache/... – floatingpurr Mar 11 '16 at 12:43sudo -Hruns the command as root, but sets the used home directory to root's home directory/rootinstead of the user's home directory/home/YOUR_USERNAMEas normalsudowould do. The warning is generated bypipbecause 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