pycairo icon indicating copy to clipboard operation
pycairo copied to clipboard

Failed to install out of the box on Mac OS Mojave - install error.

Open punkscience opened this issue 5 years ago • 2 comments

I was installing as per the Beeware / Briefcase tutorial instructions and the last step failed on Mac OS Mojave 10.14.6

Output:

(beewaretest) bash-3.2$ pipenv install pycairo
Installing pycairo…
Adding pycairo to Pipfile's [packages]…
✔ Installation Succeeded 
Pipfile.lock (209a16) out of date, updating to (a4663a)…
Locking [dev-packages] dependencies…
Locking [packages] dependencies…
✔ Success! 
Updated Pipfile.lock (209a16)!
Installing dependencies from Pipfile.lock (209a16)…
An error occurred while installing pycairo==1.18.2 --hash=sha256:dcb853fd020729516e8828ad364084e752327d4cff8505d20b13504b32b16531! Will try again.
  🐍   ▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ 34/34 — 00:00:05
Installing initially failed dependencies…
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 1992, in do_install
[pipenv.exceptions.InstallError]:       skip_lock=skip_lock,
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 1253, in do_init
[pipenv.exceptions.InstallError]:       pypi_mirror=pypi_mirror,
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 859, in do_install_dependencies
[pipenv.exceptions.InstallError]:       retry_list, procs, failed_deps_queue, requirements_dir, **install_kwargs
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 763, in batch_install
[pipenv.exceptions.InstallError]:       _cleanup_procs(procs, not blocking, failed_deps_queue, retry=retry)
[pipenv.exceptions.InstallError]:   File "/usr/local/Cellar/pipenv/2018.11.26_2/libexec/lib/python3.7/site-packages/pipenv/core.py", line 681, in _cleanup_procs
[pipenv.exceptions.InstallError]:       raise exceptions.InstallError(c.dep.name, extra=err_lines)
[pipenv.exceptions.InstallError]: ['Collecting pycairo==1.18.2', '  Using cached https://files.pythonhosted.org/packages/3c/1a/c0478ecab31baae50fda9956547788afbd0ca563adc52c9b03cab30f17eb/pycairo-1.18.2.tar.gz', 'Building wheels for collected packages: pycairo', '  Building wheel for pycairo (setup.py): started', "  Building wheel for pycairo (setup.py): finished with status 'error'", '  Running setup.py clean for pycairo', 'Failed to build pycairo', 'Installing collected packages: pycairo', '    Running setup.py install for pycairo: started', "    Running setup.py install for pycairo: finished with status 'error'"]
[pipenv.exceptions.InstallError]: ['ERROR: Command errored out with exit status 1:', '   command: /Users/darrylwright/.local/share/virtualenvs/beewaretest-cVXoSTHE/bin/python3.7 -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'/private/var/folders/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-install-zbmzalmi/pycairo/setup.py\'"\'"\'; __file__=\'"\'"\'/private/var/folders/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-install-zbmzalmi/pycairo/setup.py\'"\'"\';f=getattr(tokenize, \'"\'"\'open\'"\'"\', open)(__file__);code=f.read().replace(\'"\'"\'\\r\\n\'"\'"\', \'"\'"\'\\n\'"\'"\');f.close();exec(compile(code, __file__, \'"\'"\'exec\'"\'"\'))\' bdist_wheel -d /private/var/folders/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-wheel-_oqwphc7 --python-tag cp37', '       cwd: /private/var/folders/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-install-zbmzalmi/pycairo/', '  Complete output (17 lines):', '  running bdist_wheel', '  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', '  warning: build_py: byte-compiling is disabled, skipping.', '  ', '  running build_ext', '  Package libffi was not found in the pkg-config search path.', "  Perhaps you should add the directory containing `libffi.pc'", '  to the PKG_CONFIG_PATH environment variable', "  Package 'libffi', required by 'gobject-2.0', not found", "  Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']' returned non-zero exit status 1.", '  ----------------------------------------', '  ERROR: Failed building wheel for pycairo', '    ERROR: Command errored out with exit status 1:', '     command: /Users/darrylwright/.local/share/virtualenvs/beewaretest-cVXoSTHE/bin/python3.7 -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'/private/var/folders/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-install-zbmzalmi/pycairo/setup.py\'"\'"\'; __file__=\'"\'"\'/private/var/folders/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-install-zbmzalmi/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/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-record-f0y007zy/install-record.txt --single-version-externally-managed --compile --install-headers /Users/darrylwright/.local/share/virtualenvs/beewaretest-cVXoSTHE/bin/../include/site/python3.7/pycairo', '         cwd: /private/var/folders/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-install-zbmzalmi/pycairo/', '    Complete output (17 lines):', '    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', '    warning: build_py: byte-compiling is disabled, skipping.', '    ', '    running build_ext', '    Package libffi was not found in the pkg-config search path.', "    Perhaps you should add the directory containing `libffi.pc'", '    to the PKG_CONFIG_PATH environment variable', "    Package 'libffi', required by 'gobject-2.0', not found", "    Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']' returned non-zero exit status 1.", '    ----------------------------------------', 'ERROR: Command errored out with exit status 1: /Users/darrylwright/.local/share/virtualenvs/beewaretest-cVXoSTHE/bin/python3.7 -u -c \'import sys, setuptools, tokenize; sys.argv[0] = \'"\'"\'/private/var/folders/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-install-zbmzalmi/pycairo/setup.py\'"\'"\'; __file__=\'"\'"\'/private/var/folders/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-install-zbmzalmi/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/7q/8x8c3sjx22ddl4_8q8lhw1440000gn/T/pip-record-f0y007zy/install-record.txt --single-version-externally-managed --compile --install-headers /Users/darrylwright/.local/share/virtualenvs/beewaretest-cVXoSTHE/bin/../include/site/python3.7/pycairo Check the logs for full command output.']
ERROR: ERROR: Package installation failed...```

punkscience avatar Nov 23 '19 16:11 punkscience

I did some digging and this solution worked:

https://github.com/mesonbuild/meson/issues/2273#issuecomment-420412230

I don't really understand the 'why' but I thought I'd post this here since it may be worth understanding by someone in the project if something needs to be updated or changed.

punkscience avatar Nov 23 '19 16:11 punkscience

yeah, the libffi homebrew package is broken. Ideas to improve this welcome.

lazka avatar Nov 24 '19 09:11 lazka

libffi is still broken in homebrew to this day, but libffi seems no longer to be pulled in when requesting cairo, so this should be fixed now.

lazka avatar Nov 28 '22 19:11 lazka