I try to remove all pip installed packages from MacOSX. I'm doing it to ensure I'm using homebrew pip from now on (to avoid problems with SIP).

Following zsh loop removed most of them, but some resists.

for i ($(pip freeze )) {pip uninstall -y $i}

For example matlibplot hasn't been removed. When I try to run uninstall it find matplotlib, print related paths, but fails.

pip uninstall matplotlib
Uninstalling matplotlib-1.3.1:
Proceed (y/n)?

I got following very long error message. It seems that files cannot be removed. Error sample:

error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py', '/tmp/pip-PK6UUB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py', "[Errno 1] Operation not permitted: '/tmp/pip-PK6UUB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/__init__.py'"),

What should I do?

To make clear, commands are run from root account. Pip can find package metadata:

pip show matplotlib
Metadata-Version: 1.1
Name: matplotlib
Version: 1.3.1
Summary: Python plotting package
Home-page: http://matplotlib.org 
Author: John D. Hunter, Michael Droettboom
Author-email: [email protected]
License: BSD
Location: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requires: numpy, python-dateutil, tornado, pyparsing, nose
  Development Status :: 5 - Production/Stable
  Intended Audience :: Science/Research
  License :: OSI Approved :: Python Software Foundation License
  Programming Language :: Python
  Programming Language :: Python :: 2
  Programming Language :: Python :: 3
  Topic :: Scientific/Engineering :: Visualization

1 Answer 1


Looking at similar questions (e.g. discussion below this one) I decided temporary disable SIP. Clean pip and enable SIP again.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .