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

Import error when trying to run git-sim #2

Closed
Adricu8 opened this issue Jan 22, 2023 · 4 comments
Closed

Import error when trying to run git-sim #2

Adricu8 opened this issue Jan 22, 2023 · 4 comments

Comments

@Adricu8
Copy link

Adricu8 commented Jan 22, 2023

I installed the package on a mac M1, following the required dependencies and no errors.
When running git-sim -h:

Traceback (most recent call last):
File "/opt/homebrew/anaconda3/envs/git-sim/bin/git-sim", line 5, in
from git_sim.main import main
File "/opt/homebrew/anaconda3/envs/git-sim/lib/python3.11/site-packages/git_sim/main.py", line 1, in
import git_sim.git_sim as gs
File "/opt/homebrew/anaconda3/envs/git-sim/lib/python3.11/site-packages/git_sim/git_sim.py", line 1, in
from manim import *
File "/opt/homebrew/anaconda3/envs/git-sim/lib/python3.11/site-packages/manim/init.py", line 26, in
from .animation.composition import *
File "/opt/homebrew/anaconda3/envs/git-sim/lib/python3.11/site-packages/manim/animation/composition.py", line 16, in
from ..scene.scene import Scene
File "/opt/homebrew/anaconda3/envs/git-sim/lib/python3.11/site-packages/manim/scene/scene.py", line 38, in
from ..camera.camera import Camera
File "/opt/homebrew/anaconda3/envs/git-sim/lib/python3.11/site-packages/manim/camera/camera.py", line 16, in
import cairo
File "/opt/homebrew/anaconda3/envs/git-sim/lib/python3.11/site-packages/cairo/init.py", line 1, in
from ._cairo import * # noqa: F401,F403
^^^^^^^^^^^^^^^^^^^^^
ImportError: dlopen(/opt/homebrew/anaconda3/envs/git-sim/lib/python3.11/site-packages/cairo/_cairo.cpython-311-darwin.so, 0x0002): symbol not found in flat namespace '_cairo_append_path'

@initialcommit-io
Copy link
Contributor

Hi there,

This seems to be a known issue when installing Manim via Anaconda. Check out this link:

https://docs.manim.community/en/latest/faq/installation.html#i-am-using-anaconda-and-get-an-importerror-mentioning-that-some-symbol-is-not-found

"This is because Anaconda environments come with their own preinstalled version of cairo which is not compatible with the version of pycairo required by Manim. Usually it can be fixed by running:

conda install -c conda-forge pycairo

"

Can you try that and let me know if it works for you? Also I definitely recommend not using the system Python on Mac as it can lead to issues. Please make sure you're installing Git-Sim with a Pip that is linked to a Python installed through Homebrew. The Pyenv (https://github.com/pyenv/pyenv) tool might help with making sure the correct version of Python is active.

Let me know how it goes!

@initialcommit-io
Copy link
Contributor

@Adricu8 Any update on this?

@Adricu8
Copy link
Author

Adricu8 commented Jan 25, 2023

Indeed, it was an issue with the anaconda install.
After running conda install -c conda-forge pycairo it worked! Thank you 👍
I will try with anaconda and without it, do you know why can anaconda lead to issues?

@initialcommit-io
Copy link
Contributor

Glad it worked! As I mentioned in the comment above, this is a Manim installation issue and what they said at the link I sent is:

"This is because Anaconda environments come with their own preinstalled version of cairo which is not compatible with the version of pycairo required by Manim."

I will close this since you got it working!

It would be great to get any feedback from you in the future about using Git-Sim. Have a great week!

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

2 participants