Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

macOS install requires cairo and pkg-config dependencies from pycairo #38

Open

Description

Also filed on gftools googlefonts/gftools#106

System:

  • macOS 10.14.2
  • XCode 10.1
  • Python 3.7.2

What I did:

Attempted a new install of gftools master branch at googlefonts/gftools@8ffa69c by cloning the repository and installing with:

pip install -e .

What happened:

Installing collected packages: Werkzeug, itsdangerous, Flask, absl-py, glyphsLib, tabulate, pycairo, uharfbuzz, freetype-py, fontdiffenator, nose, olefile, simplejson, pybrowserstack-screenshots, gfdiffbrowsers, gftools
  Running setup.py install for pycairo ... error
    Complete output from command /usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/x7/vs8mbwmx1hg1vcb53nlygt0m0000gn/T/pip-install-yjt3s04w/pycairo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/x7/vs8mbwmx1hg1vcb53nlygt0m0000gn/T/pip-record-dbpg93da/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.14-x86_64-3.7
    creating build/lib.macosx-10.14-x86_64-3.7/cairo
    copying cairo/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/cairo
    copying cairo/__init__.pyi -> build/lib.macosx-10.14-x86_64-3.7/cairo
    copying cairo/py.typed -> build/lib.macosx-10.14-x86_64-3.7/cairo
    running build_ext
    'pkg-config' not found.
    Command ['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']

    ----------------------------------------
Command "/usr/local/opt/python/bin/python3.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/x7/vs8mbwmx1hg1vcb53nlygt0m0000gn/T/pip-install-yjt3s04w/pycairo/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/x7/vs8mbwmx1hg1vcb53nlygt0m0000gn/T/pip-record-dbpg93da/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/x7/vs8mbwmx1hg1vcb53nlygt0m0000gn/T/pip-install-yjt3s04w/pycairo/

How I Fixed It:

The fontdiffenator dependency PyCairo requires a homebrew install of cairo and pkg-config. I've apparently previously installed cairo, but not pkg-config.

$ brew install pkg-config
$ pip install -e .

and gftools installed without problems. Happy to file a README update PR with these instructions if I am not missing something. I checked and pkg-config does not appear to be installed with XCode CL tools. Seems to require a manual install before the pip install attempt here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions