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

What is manim_imports_ext? #108

Open
Gsparsh22 opened this issue Dec 21, 2024 · 2 comments
Open

What is manim_imports_ext? #108

Gsparsh22 opened this issue Dec 21, 2024 · 2 comments

Comments

@Gsparsh22
Copy link

How to run code with manim_imports_ext?

@AlieNiT
Copy link

AlieNiT commented Dec 24, 2024

manim_imports_ext is a Python file located in the root directory of this repository (link).

ManimGL always executes the universal_import_line at the beginning of any run. By default, this line is from manimlib import *.

However, the configuration can be modified using custom_config.py (typically located in the directory where you are running ManimGL). Grant has changed the universal_import_line to from manim_imports_ext import * (link). This modification requires Python to locate manim_imports_ext.py. If the PYTHONPATH environment variable is not set to the repository's root directory, an error will occur (other methods might work, but this is the one I am familiar with).

In summary, before running ManimGL, ensure the PYTHONPATH is set to the repository's root directory. You can do this by prepending PYTHONPATH=. to the manimgl command (e.g., PYTHONPATH=. manimgl).

Finally, note that, to the best of my knowledge, this setup is integral to how the entire repository functions. Simply commenting out the import line in the configuration file may not work, as other parts of the code also assume the PYTHONPATH points to the project's root directory.

@Gsparsh22
Copy link
Author

okk, had a different PYTHONPATH environment variable other than the repo root, so had an error. Thanks for helping

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