question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installation on macOS 10.12 with pip fails

See original GitHub issue

I’m trying to install fontTools system-wide using the command sudo -H pip install fonttools.

I think the system integrity protection disallows writing into /System/Library/Frameworks/Python.framework/Versions/2.7/share. If you run the same command sudo -H pip install fonttools again, no traceback happens, but fontTools are left in a broken state, e.g. the command line tools are not installed in /usr/bin/local.

$ sudo -H pip install fonttools
Collecting fonttools
  Using cached fonttools-3.4.0-py2.py3-none-any.whl
Installing collected packages: fonttools
Exception:
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 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/share'

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

4reactions
anthrotypecommented, Jan 6, 2017

Never install third party packages with sudo to the system python, use homebrew python or the python installer from Python.org; if you do want to use the system python pip install with --user option.

3reactions
anthrotypecommented, Jan 9, 2017

of course, there’s also a third option: i.e. don’t install the man page, as it’s outdated and only works on Linux.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I can't install PIP on MacOS Sierra - Stack Overflow
For Mac OS Sierra, cannot install pip via easy_install. So install pip using curl as follows, curl https://bootstrap.pypa.io/get-pip.py ...
Read more >
I am trying to install pip on terminal and I always get this error
I am trying to install pip on terminal and I always get this error · Have you used the --user option, or checked...
Read more >
How to Install Pip on Mac - phoenixNAP
Install Pip on macOS via get-pip.py · 1. Press Command + Space Bar and type in Terminal. Click the app icon to open...
Read more >
pip Command Not Found – Mac and Linux Error Solved
Sometimes when you are installing packages, you might face the error: pip: command not found . This error could be due to the...
Read more >
Installing Python 3 on Mac OS X
The latest version of Mac OS X, High Sierra, comes with Python 2.7 out of the box. You do not need to install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found