gftools: Installation errors on the command line

I’m trying to work with a Google Font and I’m running into issues with setting up gftools to do so.

Specifically, sudo easy_install pip went fine, but then pip install --upgrade gftools ran partially, but failed with the following error:

OSError: [Errno 1] Operation not permitted: '/System/Library/Frameworks/Python.framework/Versions/2.7/share'

I tried to use sudo chown stephennixon /Library/Python/2.7/site-packages to get past this on the suggestion of a Stack Overflow post, then ran pip install --upgrade gftools again.

Now, I’m getting this error:

Error: [('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc', "[Errno 1] Operation not permitted: '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py', "[Errno 1] Operation not permitted: '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py', "[Errno 1] Operation not permitted: '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/markers.py'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc', "[Errno 1] Operation not permitted: '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib/__init__.pyc'"), ('/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib', "[Errno 1] Operation not permitted: '/var/folders/tq/g3lct8f965z_nw5y9fxbg7_h0000gn/T/pip-5aajiB-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_markerlib'")]

I’ve Googled / Stack Overflowed around for the solution, plus looked around the issues on this repo, but nothing’s standing out. I’m new to Python, so I’m a bit unsure of how to proceed. Any suggestions would be greatly appreciated!

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 63 (63 by maintainers)

Most upvoted comments

yeah… They don’t care about 🐍 anymore now that they have 🐥

Going to close this issue because it’s no longer an active discussion.

A huge thank you to everyone who pitched in to give me good information in my earliest days of Python use!

If anyone else comes across this: I’ve been using virtualenv for a while now, and it’s been super helpful. I found this tutorial from The Hitchhiker’s Guide to Python to be very useful. It’s even better if you connect your virtualenv activation commands to bash aliases!

what do we write on the README

remove all instructions, link to official docs, not your job to tell ppl how to install/setup their python

Yeah… this thread ended up becoming a chat room LOL

Let’s try to refocus on answering this objective question:

what do we write on the README of this repo to make it safe and harmless for (potentially clueless) users to install gftools without messing up their systems?

yeah, though telling people to add export PATH=… to ~/.bash_profile is not very type-designer-friendly based on our previous discussion. Anyway, we spent way too much time on this. Just point people to the official python and pip docs, and they’ll figure out by themselves like we all did (ie. google, stack overflow and a lot of patience)

I just reinstalled it and I got this

==> Caveats
This formula installs a python2 executable to /usr/local/bin.
If you wish to have this formula's python executable in your PATH then add
the following to ~/.bash_profile:
  export PATH="/usr/local/opt/python/libexec/bin:$PATH"

Pip and setuptools have been installed. To update them
  pip2 install --upgrade pip setuptools

You can install Python packages with
  pip2 install <package>

They will install into the site-package directory
  /usr/local/lib/python2.7/site-packages

See: https://docs.brew.sh/Homebrew-and-Python.html

that’s the message that should be printed when you brew install python now

 This formula installs a python2 executable to #{HOMEBREW_PREFIX}/bin.
 If you wish to have this formula's python executable in your PATH then add
 the following to #{shell_profile}:
    export PATH="#{opt_libexec}/bin:$PATH"

it looks like it was intentional https://github.com/Homebrew/homebrew-core/commit/e7f4e1c03abbe0842b77e3d163e737a81ca955e7

homebrew python no longer shadows the system python…

Problem was that the symlink in /usr/local/bin disappeared at some stage of updates (likely OS based upon the timeframe when this occurred). Here is the workaround that I used to manually create the python symlink in /usr/local/bin for anyone else having the same issue:

$ ln -s ../Cellar/python/2.7.14/bin/python2 /usr/local/bin/python

Now python reports proper Homebrew version of Python2 (2.7.14). This is likely the same fix for you @thundernixon

python setup.py install will use the deprecated easy_install.py module from setuptools, will create an .egg instead of a wheel package, will attempt to resolve dependencies via easy_install and thus build .eggs from the source distributions (zip or tar.gz) available on PyPI, but the latter may fail in case of packages that require a C/C++ compiler because they include extension modules, and the compiler is missing on the user’s environment. That’s why I always recommend to install with pip, even from a git source tree (pip install -e .).

in short, pip + wheels are the best way to install third party modules.

Well, after chasing this around, I think I got gftools to install without error, though which python still points to /usr/bin/python and not /usr/local/bin/python. I’ll try the builds I’m hoping to do, and see whether they work. Thanks for your help and input!

Just to chime in on the conversation as one user, I do like the command line for a few things: I use it for git, and I’ve used it for running some web-dev build processes in the past. For this, I do have some level of experience with Homebrew and npm. However, I haven’t yet done a lot of other types of software development yet, and my current type design knowledge is mostly around drawing with beziers, rather than Python production techniques. I’m working on this, but of the type designers I know, only the nerdier ones really dive into a lot of development. 😃

Having said that, Platypus sounds cool, but I think that’s too much. I’m not willing to follow that path.

BTW, easy_install is now deprecated as an installation tool (replaced by pip itself). Nowadays, pip comes pre-installed with most python distributions, such as the official python.org or homebrew. To bootstrap pip, one should either do python -m ensurepip or use the get-pip.py script