macOS: rm: /usr/bin/python: Operation not permitted — even with sudo
System Integrity Protection blocks changes to protected system locations, even for root.
rm: Operation not permittedmv: rename to /usr/bin: Operation not permittedSystem Integrity Protection operation not permitted/usr/bin: Operation not permitted macOS even with sudoln: /usr/bin/x: Operation not permitted Meaning
SIP protects /System, /usr (except /usr/local), /bin, /sbin and Apple apps. The fix is not to disable SIP but to work in allowed places: install tools under /usr/local, /opt/homebrew or your home folder, and change PATH. For files protected by privacy (Desktop/Documents) the cause is Full Disk Access, not SIP.
Common causes
- Modifying files under /System, /usr/bin, /bin, /sbin
- Trying to replace system Python/Ruby
- Installer writing to a protected path
- Flag
restrictedon the file (ls -lO) - Confusing SIP with TCC privacy permissions
⚡ Quick fix
- Install into /usr/local, /opt/homebrew or ~/
- Put your tool earlier in PATH instead of replacing the system one
- Check flags:
ls -lO /usr/bin/python3showsrestricted
Detailed fix by platform
macOS
csrutil statusshows whether SIP is enabled;ls -lO pathshows the restricted flag
How to diagnose
- Path — Protected by SIP?
- Cause — SIP or Full Disk Access?
- Alternative — /usr/local?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- Docker Desktop requires privileged access (vmnetd) macOS: Docker Desktop needs privileged access / com.docker.vmnetd could not be started
- Homebrew: Permission denied @ dir_s_mkdir Homebrew: Error: Permission denied @ dir_s_mkdir - /usr/local/Cellar / /opt/homebrew is not writable
- Item is locked / cannot be deleted (chflags uchg) macOS: The operation can't be completed because the item is locked / rm: Operation not permitted (uchg flag)
Most viewed in macOS
- is damaged and can’t be opened macOS: “App” is damaged and can’t be opened. You should move it to the Trash.
- git: 'credential-osxkeychain' is not a git command Git: git: 'credential-osxkeychain' is not a git command. See 'git --help'
- fork: Resource temporarily unavailable macOS: -bash: fork: Resource temporarily unavailable (process limit reached)
Other ways to find it
Where this error sits
Origin: Platform & cloud. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026