---
title: "Mac OS X 10.11.5 pip install getting Operation Not Permitted error"
author: "fuzhaohui"
date: "2016-09-30T15:06:47Z"
tags: []
categories: ["操作系统"]
slug: "mac-os-x-10-11-5-pip-install-getting-operation-not-permitted-error"
draft: false
lastmod: "2016-09-30T15:06:47Z"
id: 2328038
url: "https://fuzhaohui.iteye.com/blog/2328038"
---

The new versions of Mac Os come with high restrictions on what you can do and is called: [System Integrity Protection](https://support.apple.com/en-us/HT204899).

There is unfortunately not much we can do about that, and anyway the reason for System Integrity Protections seem to be reasonable.

Plus usually you do not want to install things systemwide, there is no reason to use `sudo` in front of`pip`. If you don't have the permissions, there is likely a good reason.

You should be able to install any packages as user by using the `--user`:

```
pip install ipython --user
```

Which will have the advantage of installing in your home, where you have ~0 chance of breaking your system. Moreover it will not require you to use `sudo` that you shouldn't have to use anyway.

I would also encourage you to not use system-python on a mac:  
1\) It's never up to date, and is linked weirdly with some binary libraries  
2\) It's Python2.7, which [will not be supported anymore soon](http://python3statement.github.io/)

Prefer [`brew install python`/`brew install python3`](http://brew.sh/) that have complete separate Python installation that do not require sudo either. Or, [anaconda](https://www.continuum.io/downloads) that does the same, support multiple environment, and have binary of many python packages that Homebrew lacks.