Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in installing pycairo to Mac OS. #524

Closed
GrouperTamaki opened this issue May 3, 2019 · 5 comments
Closed

Error in installing pycairo to Mac OS. #524

GrouperTamaki opened this issue May 3, 2019 · 5 comments

Comments

@GrouperTamaki
Copy link

GrouperTamaki commented May 3, 2019

Hello, I'm a science YouTuber in Japan with subscribers 10000+.

I'm such a big fan of 3Blue1Brown's video that I started to upload mathematical videos. These days, 3b1b's video makes me want to make mathematical animations like him.

Today, I tried to install manim to my Mac OS Mojave (ver 10.14.4), following Brian Howell's website (http://bhowell4.com/manic-install-tutorial-for-mac/). But I have a trouble in installing pycairo.

... - ... -MacBook-Pro:manim kasagonaoki$ pip install pycairo
Collecting pycairo
Using cached https://files.pythonhosted.org/packages/48/20/5e83af98eb897935bf7dc39455e892ba866feebb9b7c3b392982866f9958/pycairo-1.18.1.tar.gz
Installing collected packages: pycairo
Running setup.py install for pycairo ... error

ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/94/qz1q_1015gq84sdfwns2f8hm0000gn/T/pip-install-s_02k2sk/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/94/qz1q_1015gq84sdfwns2f8hm0000gn/T/pip-record-jskbs96p/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/cairo
copying cairo/init.py -> build/lib.macosx-10.9-x86_64-3.7/cairo
copying cairo/init.pyi -> build/lib.macosx-10.9-x86_64-3.7/cairo
copying cairo/py.typed -> build/lib.macosx-10.9-x86_64-3.7/cairo
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 "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/94/qz1q_1015gq84sdfwns2f8hm0000gn/T/pip-install-s_02k2sk/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/94/qz1q_1015gq84sdfwns2f8hm0000gn/T/pip-record-jskbs96p/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/94/qz1q_1015gq84sdfwns2f8hm0000gn/T/pip-install-s_02k2sk/pycairo/

How do I attack this problem ?

@mrichman
Copy link

mrichman commented May 3, 2019

Same error here.

@mrichman
Copy link

mrichman commented May 3, 2019

This solved my problem:

export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
export LDFLAGS="-L/usr/local/opt/libffi/lib" 

@GrouperTamaki
Copy link
Author

Thank you ! Your suggestion solved the problem !

@GrouperTamaki GrouperTamaki changed the title Error in installing pycairo Mac OS X. Error in installing pycairo to Mac OS. May 3, 2019
@BraverChiang
Copy link

Here is what I did, I'm not familiar to Linux, the problem is still there, how to do next? thank you so much @mrichman

export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig"
➜ ~ export LDFLAGS="-L/usr/local/opt/libffi/lib"
➜ ~ pip3 install pycairo
Looking in indexes: https://pypi.python.org/simple, https://pypi.apple.com/simple
Collecting pycairo
Downloading https://files.pythonhosted.org/packages/48/20/5e83af98eb897935bf7dc39455e892ba866feebb9b7c3b392982866f9958/pycairo-1.18.1.tar.gz (200kB)
|████████████████████████████████| 204kB 202kB/s
Building wheels for collected packages: pycairo
Building wheel for pycairo (setup.py) ... error
ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/d3/lf6l3m_j6cq3vt06_jqbxjw00000gn/T/pip-install-vc8gwgfl/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/d3/lf6l3m_j6cq3vt06_jqbxjw00000gn/T/pip-wheel-xf8zf67r --python-tag cp37:
ERROR: running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/cairo
copying cairo/init.py -> build/lib.macosx-10.9-x86_64-3.7/cairo
copying cairo/init.pyi -> build/lib.macosx-10.9-x86_64-3.7/cairo
copying cairo/py.typed -> build/lib.macosx-10.9-x86_64-3.7/cairo
running build_ext
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']' returned non-zero exit status 1.

ERROR: Failed building wheel for pycairo
Running setup.py clean for pycairo
Failed to build pycairo
Installing collected packages: pycairo
Running setup.py install for pycairo ... error
ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/d3/lf6l3m_j6cq3vt06_jqbxjw00000gn/T/pip-install-vc8gwgfl/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/d3/lf6l3m_j6cq3vt06_jqbxjw00000gn/T/pip-record-9vmu83gb/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/cairo
copying cairo/init.py -> build/lib.macosx-10.9-x86_64-3.7/cairo
copying cairo/init.pyi -> build/lib.macosx-10.9-x86_64-3.7/cairo
copying cairo/py.typed -> build/lib.macosx-10.9-x86_64-3.7/cairo
running build_ext
Package cairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `cairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'cairo' found
Command '['pkg-config', '--print-errors', '--exists', 'cairo >= 1.13.1']' returned non-zero exit status 1.
----------------------------------------
ERROR: Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;file='"'"'/private/var/folders/d3/lf6l3m_j6cq3vt06_jqbxjw00000gn/T/pip-install-vc8gwgfl/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/d3/lf6l3m_j6cq3vt06_jqbxjw00000gn/T/pip-record-9vmu83gb/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/d3/lf6l3m_j6cq3vt06_jqbxjw00000gn/T/pip-install-vc8gwgfl/pycairo/

@Kolloom Kolloom mentioned this issue Jul 17, 2019
@Kolloom
Copy link
Contributor

Kolloom commented Jul 17, 2019

@BraverChiang You need to install the cairo library https://stackoverflow.com/questions/1500866/how-to-install-pycairo-on-osx

brew install cairo and rerun pip install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants