pypa/pip — Issue #440: pip install --user tries to uninstall system package
Author: npinto
Created: 2012-01-27 19:16:29+00:00
State: open

I'm trying to install a package into my $PYTHONUSERBASE (see PEP370) using --user but since my system already has an older version pip is trying to uninstall the system version and fails.

```
$ pip install --no-deps --user git+https://github.com/fabric/fabric.git
Downloading/unpacking git+https://github.com/fabric/fabric.git
Cloning https://github.com/fabric/fabric.git to /tmp/pip-hmaLKb-build
Running setup.py egg_info for package from git+https://github.com/fabric/fabric.git

warning: no previously-included files matching '*' found under directory 'docs/_build'
warning: no files found matching 'fabfile.py'
Installing collected packages: Fabric
Found existing installation: Fabric 1.3.3
Uninstalling Fabric:
Exception:
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/usr/lib64/python2.7/site-packages/pip/commands/install.py", line 228, in run
requirement_set.install(install_options, global_options)
File "/usr/lib64/python2.7/site-packages/pip/req.py", line 1096, in install
requirement.uninstall(auto_confirm=True)
File "/usr/lib64/python2.7/site-packages/pip/req.py", line 482, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/lib64/python2.7/site-packages/pip/req.py", line 1398, in remove
renames(path, new_path)
File "/usr/lib64/python2.7/site-packages/pip/util.py", line 255, in renames
shutil.move(old, new)
File "/usr/lib64/python2.7/shutil.py", line 299, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/bin/fab'

Storing complete log in /home/npinto/.pip/pip.log
```