Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrade Pip error message

When i run

    pip install --upgrade pip

I get this error message:

    Collecting pip
    Downloading pip-8.1.0-py2.py3-none-any.whl (1.2MB)
    100% |████████████████████████████████| 1.2MB 371kB/s 
    Installing collected packages: pip
    Found existing installation: pip 8.0.2
    Uninstalling pip-8.0.2:
    Exception:
    Traceback (most recent call last):
    File "/Library/Python/2.7/site-packages/pip/basecommand.py", line       209, in main
    status = self.run(options, args)
    File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
    File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line  725, in install
    requirement.uninstall(auto_confirm=True)
    File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 752, in uninstall
    paths_to_remove.remove(auto_confirm)
    File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py",line 115, in remove
    renames(path, new_path)
    File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 266,   in renames
    shutil.move(old, new)
    File"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
    os.unlink(src)
    OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site- packages/pip-8.0.2.dist-info/DESCRIPTION.rst'

Previously I had been struggling to install and run a couple of python modules so I remember moving files around a bit. Is that what has caused this error? How can I fix this? I am on Mac.

I was trying to install bs4 prior to this and I got similar error messages. (But i suspect the bs4 install has more issues so that's another question for later).

Also sorry for any format issues with the code. Have tried my best to make it look like it is on the terminal.

Thanks.

like image 919
C2P1 Avatar asked Mar 09 '16 14:03

C2P1


People also ask

How do you fix warning there was an error checking the latest version of pip?

Solution 1: Just Upgrade Your PIP But Sometimes Its fail to check Recent Update And That's Why You are facing This Warning Message You can Ignore This Message Or You can Just Update Your PIP to its latest version and then You'll No More face this warning message.

How can I upgrade my pip version?

Updating Pip When an update for pip is available, and you run a pip command, you will see a message that says, “You are using pip version xy. a, however version xy. b is available.” You can run “pip install --upgrade pip” to install and use the new version of pip.

How do I give permission to upgrade pip?

Try to give permission to full control the python folder. Find the python root directory-->right button click-->properties-->security-->edit-->give users Full Control-->yes and wait the process finished.


2 Answers

A permission issue means your user privileges don't allow you to write on the desired folder(/Library/Python/2.7/site-packages/pip/). There's basically two things you can do:

  1. run pip as sudo:

    sudo pip install --upgrade pip
    
  2. Configure pip to install only for the current user, as covered here and here.
like image 104
Bernardo Meurer Avatar answered Oct 16 '22 10:10

Bernardo Meurer


The best way to do it is as follows:

$ python3 -m pip install --upgrade pip

as it's generally not advised to use

$ sudo pip install

More answers can be found here: https://github.com/pypa/pip/issues/5599

like image 25
kgebreki Avatar answered Oct 16 '22 08:10

kgebreki