1
votes

I try to upgrade pip with pip install -U pip and I get:

Collecting pip Using cached pip-8.0.2-py2.py3-none-any.whl

Installing collected packages: pip Found existing installation: pip 7.1.0 Uninstalling pip-7.1.0:

Exception:

Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 223, in main status = self.run(options, args)

File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 299, in run root=options.root_path,

File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 640, in install requirement.uninstall(auto_confirm=True) File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 726, in uninstall paths_to_remove.remove(auto_confirm)

File "/usr/local/lib/python2.7/dist-packages/pip/req/req_uninstall.py", line 125, in remove renames(path, new_path)

File "/usr/local/lib/python2.7/dist-packages/pip/utils/init.py", line 314, in renames shutil.move(old, new)

File "/usr/lib/python2.7/shutil.py", line 303, in move os.unlink(src)

OSError: [Errno 13] Permission denied: '/usr/bin/pip'

3

3 Answers

0
votes

Looks you are getting a permission error, try running your command as super user:

sudo pip install -U pip
0
votes

Looks like you don't have permission to write to the system folder. You can avoid the problem by installing the packages to the user folder. So this is the code you have to use for upgrading the pip.

python -m pip install --user --upgrade pip
0
votes

add python to your command with --user. It should work

python -m pip install --user --upgrade pip