Mac Upgrade pip Error OSError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/pip-9.0.1-py2….

Error Message:

Exception:

Traceback (most recent call last):

  File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py”, line 215, in main

    status = self.run(options, args)

  File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py”, line 342, in run

    prefix=options.prefix_path,

  File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py”, line 778, in install

    requirement.uninstall(auto_confirm=True)

  File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py”, line 754, in uninstall

    paths_to_remove.remove(auto_confirm)

  File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py”, line 115, in remove

    renames(path, new_path)

  File “/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py”, line 267, in renames

    shutil.move(old, new)

  File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 300, in move

    rmtree(src)

  File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 247, in rmtree

    rmtree(fullname, ignore_errors, onerror)

  File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 252, in rmtree

    onerror(os.remove, fullname, sys.exc_info())

  File “/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py”, line 250, in rmtree

    os.remove(fullname)

OSError: [Errno 13] Permission denied: ‘/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/EGG-INFO/PKG-INFO’

You are using pip version 9.0.1, however version 19.1.1 is available.

You should consider upgrading via the ‘pip install –upgrade pip’ command.

How to Solve this error:

When using pip to update a Python library under Mac, it prompts that the pip version is too low. The command line at the bottom shows that it needs to be upgraded. The upgrade command is: You should consider upgrading via the’pip install –upgrade pip’ command.

The command input given by the installation: pip install –upgrade pip; after the result is executed, the same error is still reported.

After retries N times, the execution still failed.

Finally, after searching online, I found out that it was a permission problem. Modify the execution command as follows: 

sudo  pip install –upgrade pip 

 

Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *