Pip: Pip issues while installing requirements, OSError: [Errno 1] Operation not permitted:

Created on 20 Jan 2017  ·  3Comments  ·  Source: pypa/pip

  • Pip version: pip 9.0.1 from /Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg (python 2.7)
  • Python version: 2.7
  • Operating system: Mac OS 10

Description: sudo pip install -r requirements.txt

// REPLACE ME: Install requirements.

What I've run:


Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
prefix=options.prefix_path,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
**kwargs
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 377, in move_wheel_files
clobber(source, dest, False, fixer=fixer, filter=filter)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 316, in clobber
ensure_dir(destdir)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/init.py", line 83, in ensure_dir
os.makedirs(path)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/share'```

```

auto-locked

Most helpful comment

You could tell pip to pass --install-data option to setup.py install and use different folder outside of SIP protection, e.g. /usr/local
https://github.com/fonttools/fonttools/issues/796#issuecomment-271869673

Or simply use --user, or even better avoid using Apple python altogether.

All 3 comments

That's the same problem as #3177, which is actually a bug caused by Apple Inc. rather than pip.

You could tell pip to pass --install-data option to setup.py install and use different folder outside of SIP protection, e.g. /usr/local
https://github.com/fonttools/fonttools/issues/796#issuecomment-271869673

Or simply use --user, or even better avoid using Apple python altogether.

Nothing to do here for pip.
This should also happen less often once #1668 is implemented.

Was this page helpful?
0 / 5 - 0 ratings