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

Error Message:


Traceback (most recent call last):

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

    status =, args)

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


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


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


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

    renames(path, new_path)

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

    shutil.move(old, new)

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


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

    rmtree(fullname, ignore_errors, onerror)

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

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

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


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 *