I happen to have some unused/obsolete python libraries in System directory, especially in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python, the issue is that I can't delete any file in the library anymore. I guess it's happening after upgrading to 10.11.

I tried sudo rm -rf, but I just can't delete any file in it.

python> sudo rm -rf *.pyc
rm: easy_install.pyc: Operation not permitted
rm: pkg_resources.pyc: Operation not permitted
rm: pylab.pyc: Operation not permitted
rm: pyparsing.pyc: Operation not permitted
rm: six.pyc: Operation not permitted

enter image description here

What might be done to remove them?

3 Answers 3


Do not touch the System directory! Those are files that the system may or may not need in the future (or currently). OS X uses Python, so just because you may not need the module, that doesn't mean that OS X doesn't. Really, this is why they created SIP in the first place.

  • 1
    +1 These files are NOT "unused/obsolete", they're part of a standard install of El Capitan and should not be messed with. I would disagree with this being the reason SIP was created, though -- it's not really intended to protect users from themselves, it's primarily a security layer to limit the kinds of damage malware can do if it gets root. Nov 6, 2015 at 20:41
  • 2
    Well, I'd say there were at least a few reasons. Certainly it's hugely advantageous as a layer that protects the system from processes that do bad things with root access, but the amount of people I see on the internet asking for help with what's analogous to surgery on a computer, who seem to know very little about the computer they're operating on, tells me that SIP will, without a doubt, result in a great decrease in a large portion of common corruption scenarios. Nov 6, 2015 at 20:46
  • 1
    6 months later and the answer to every question is "Disable SIP and then you can do the thing you want to." Apr 5, 2017 at 8:10
  • 3
    These answers and comments are so frustrating! I look up Apple community, then Apple StackExchange, etc. The answers are always "don't you dare!". How about explaining the reason? I am a coder, I install things sometimes at the system level, including things that get installed into the System/Library path. Now, like the OP, I would like to clean them up. There is no acceptable way that Apple has allowed. Which leads to their ultimate goal: we all collectively decide our computers "have become" too slow and we need to buy another (or do a fresh install). Frustrating!! Dec 20, 2017 at 16:48
  • 1
    @WilliamTFroggard Well, minimally languages are installed there. A quick look at that top level (/System/Library) shows me Perl & Java. Which comes back to that age-old problem: there is the version of the language that the OS uses, and the version that we all use. It would be nice if, for instance, I didn't need multiple flavors of each language I'm planning on using. Dec 28, 2017 at 1:01

The directories are protected by System Integrity Protection in OS X El Capitan.

In order to disable it:

  1. Reboot & hold Cmd ⌘ R at the chimes
  2. Open Terminal
  3. Type csrutil disable; reboot

Hints from http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/

It isn't advisable to actually do this, however. Deleting files in the System directory could have unforeseeable and potentially disastrous consequences.


These aren't your files. You absolutely do not understand what you are doing. Other people have already told you this, but not what you actually need to do instead.

Here is a decent rundown on how to set up your own parallell python installation with Homebrew, and then virtualenv on top of that so you don't run into conflicts.

The only reason anyone should ever touch /System is if they're running a hackintosh.

Edit: using pip with virtualenv is what you should do by default anyways. It's not a last resort for when you run into issues.


You must log in to answer this question.

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