3b1b / manim

Animation engine for explanatory math videos
MIT License
61.96k stars 5.77k forks source link

Value Error #265

Open virajbshah opened 6 years ago

virajbshah commented 6 years ago

While trying the example in the README.md, I get the error:

D:\manim-master>python extract_scene.py example_scenes.py SquareToCircle -pl Traceback (most recent call last): File "extract_scene.py", line 283, in <module> main() File "extract_scene.py", line 243, in main module = get_module(config["file"]) File "extract_scene.py", line 237, in get_module return get_module_windows(file_name) File "extract_scene.py", line 222, in get_module_windows last_module = imp.load_module(part, *load_args) File ".\example_scenes.py", line 4, in <module> from .big_ol_pile_of_manim_imports import * ValueError: Attempted relative import in non-package

What do I do?

EDIT:

I did a bit of research and instead of using python extract_scene.py example_scenes.py SquareToCircle -pl I used python -m big_ol_pile_of_manim_imports extract_scene.py example_scenes.py SquareToCircle -pl

Now I don't get any error, but I don't get any preview or output either :P

zimmermant commented 6 years ago

In the file example_scenes.py remove the period from the beginning of the line .big_ol_pile_of_manim_imports import *. That should fix the relative import error.

virajbshah commented 6 years ago

I tried it. I just get two empty folders: designs and animations

eulertour commented 5 years ago

Are you still seeing this issue? If so, have you verified that you're using python 3.7?

vignesh99 commented 2 years ago

Hello @zimmermant @eulertour , I am also facing an error when running manim class_name which is defined in file that uses relative import. Is this common to happen? Is there no way I can have a relative import and run the manim command in the terminal? Please let me know.