1

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:
 /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib
 /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib-1.3.1-py2.7.egg-info
 /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pylab.py
 /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pylab.pyc
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: mdroe@stsci.edu
License: BSD
Location: /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python
Requires: numpy, python-dateutil, tornado, pyparsing, nose
Classifiers:
  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
3

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

  • Great! Please mark this as answered then. – JMY1000 Apr 15 '16 at 18:46

You must log in to answer this question.

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