3b1b / manim

Animation engine for explanatory math videos
MIT License
68.01k stars 6.07k forks source link

manim: Scene and TEX_DIR not defined #905

Closed MartinWy closed 4 years ago

MartinWy commented 4 years ago

If this is a support request:

Dear all

I really have done my best to solve problems and have (as a newbi) spent 4 days installing manim. Now allmost everything is fine. Except:...

When running the manim_tutorial_1 it tells me (in the last line) that the name 'Scene' ist not defined.

when I try to run python3 -m manim example_scenes.py WriteStuff -pl it gives me the following

(venv) Martins_Mac:manim37 Martin$ python3 -m manim manim_tutorial_1.py Shapes -pl Traceback (most recent call last): File "/Users/Martin/.pyenv/versions/3.7.6/lib/python3.7/runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "/Users/Martin/.pyenv/versions/3.7.6/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "/Volumes/Daten/Animations/manim37/manim.py", line 5, in manimlib.main() File "/Volumes/Daten/Animations/manim37/manimlib/init.py", line 11, in main config = manimlib.config.get_configuration(args) File "/Volumes/Daten/Animations/manim37/manimlib/config.py", line 184, in get_configuration module = get_module(args.file) File "/Volumes/Daten/Animations/manim37/manimlib/config.py", line 179, in get_module spec.loader.exec_module(module) File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "manim_tutorial_1.py", line 3, in class Shapes(Scene): NameError: name 'Scene' is not defined

when I try to run python3 -m manim example_scenes.py WriteStuff -pl it gives me back the following

Traceback (most recent call last): File "/Volumes/Daten/Animations/manim37/manimlib/extract_scene.py", line 155, in main scene = SceneClass(scene_kwargs) File "/Volumes/Daten/Animations/manim37/manimlib/scene/scene.py", line 53, in init self.construct() File "example_scenes.py", line 102, in construct tex_to_color_map={"text": YELLOW} File "/Volumes/Daten/Animations/manim37/manimlib/mobject/svg/tex_mobject.py", line 148, in init self, self.arg_separator.join(tex_strings), kwargs File "/Volumes/Daten/Animations/manim37/manimlib/mobject/svg/tex_mobject.py", line 44, in init self.template_tex_file_body File "/Volumes/Daten/Animations/manim37/manimlib/utils/tex_file_writing.py", line 19, in tex_to_svg_file dvi_file = tex_to_dvi(tex_file) File "/Volumes/Daten/Animations/manim37/manimlib/utils/tex_file_writing.py", line 48, in tex_to_dvi "-output-directory=" + TEX_DIR, NameError: name 'TEX_DIR' is not defined

I run on Highsierra python 3.7 ( due to old MacbookPro)

Requirements argparse==1.4.0 colour==0.1.5 numpy==1.15.0 Pillow==5.2.0 progressbar==2.5 scipy==1.1.0 tqdm==4.24.0 opencv-python==3.4.2.17 pycairo==1.17.1 pydub==0.23.0

Many thanks

Martin

Elteoremadebeethoven commented 4 years ago

Did you install manim with PIP? That is, using:

pip install manimlib

Or did you download the repository locally?

MartinWy commented 4 years ago

I uesd the link from the tutorial: git clone https:// github.com/3b1b/manim.git

Am 04.03.2020 um 21:24 schrieb Alexander Vázquez notifications@github.com:

www.Fraktales-Lernen.education Blog https://fraktales-lernen.education/category/blog/

MartinWy commented 4 years ago

did not use pip3 install minimlib

MartinWy commented 4 years ago

would you recommend? or not?

Elteoremadebeethoven commented 4 years ago

Since you have everything installed you should be able to run it. Try restarting your Mac and try again. If not, download this version of manim and run the same:

python3 -m manim example_scenes.py WriteStuff -pl

If it doesn't work, then install manim with PIP, but now you would run manim using:

manim example_scenes.py WriteStuff -pl
MartinWy commented 4 years ago

hey many thaniks. Now the problem with the missing TEX_DIR is gone. However it gives me a syntax error from manimlib.utils.tex_file_writing import tex_to_svg_file File "/Volumes/Daten/Animations/manim/manimlib/utils/tex_file_writing.py", line 59 return result

The arrow is under the n of return.

your second suggestion: install "manim with pip" pls explain further: on what level using pip 3 or pip?

Am 04.03.2020 um 21:40 schrieb Alexander Vázquez notifications@github.com:

Since you have everything installed you should be able to run it. Try restarting your Mac and try again. If not, download this version https://github.com/3b1b/manim/tree/3b088b12843b7a4459fe71eba96b70edafb7aa78 of manim and run the same:

python3 -m manim example_scenes.py WriteStuff -pl If it doesn't work, then install manim with PIP, but now you would run manim using:

manim example_scenes.py WriteStuff -pl — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/3b1b/manim/issues/905?email_source=notifications&email_token=AOVSL4BA2A2WSPOWRPRHKV3RF24B5A5CNFSM4LBHMX4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN2EREA#issuecomment-594823312, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVSL4GEEKP3EPYO3ZDDDXTRF24B5ANCNFSM4LBHMX4A.

www.Fraktales-Lernen.education Blog https://fraktales-lernen.education/category/blog/

MartinWy commented 4 years ago

found how to install manim (=manimlib) installed it outside the venv and inside

now I run into a reference problem File "example_scenes.py", line 3, in from big_ol_pile_of_manim_imports import * ModuleNotFoundError: No module named 'big_ol_pile_of_manim_imports'

Am 04.03.2020 um 21:40 schrieb Alexander Vázquez notifications@github.com:

Since you have everything installed you should be able to run it. Try restarting your Mac and try again. If not, download this version https://github.com/3b1b/manim/tree/3b088b12843b7a4459fe71eba96b70edafb7aa78 of manim and run the same:

python3 -m manim example_scenes.py WriteStuff -pl If it doesn't work, then install manim with PIP, but now you would run manim using:

manim example_scenes.py WriteStuff -pl — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/3b1b/manim/issues/905?email_source=notifications&email_token=AOVSL4BA2A2WSPOWRPRHKV3RF24B5A5CNFSM4LBHMX4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEN2EREA#issuecomment-594823312, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVSL4GEEKP3EPYO3ZDDDXTRF24B5ANCNFSM4LBHMX4A.

www.Fraktales-Lernen.education Blog https://fraktales-lernen.education/category/blog/

Elteoremadebeethoven commented 4 years ago

Replace big_ol_pile_of_manim_imports import with manimlib.imports

MartinWy commented 4 years ago

done thx

now the second error that I initially reportet pops up:

File "example_scenes.py", line 16, in class OpeningManimExample(Scene): NameError: name 'Scene' is not defined

Am 07.03.2020 um 09:08 schrieb Alexander Vázquez notifications@github.com:

Replace big_ol_pile_of_manim_imports import with manimlib.imports

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/3b1b/manim/issues/905?email_source=notifications&email_token=AOVSL4CWIYA4VKQHHHEJMWLRGH6JXA5CNFSM4LBHMX4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEODSOXQ#issuecomment-596059998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVSL4A4BUTDTVEWAE2MLVTRGH6JXANCNFSM4LBHMX4A.

www.Fraktales-Lernen.education Blog https://fraktales-lernen.education/category/blog/

MartinWy commented 4 years ago

and what is interesting:

before under python3 -m manim ......

the SquareToCircle ran without problem. Only the WriteStuff made problems

Now the scene definition problem comes up even in the SquaretoCircle part.

Am 07.03.2020 um 09:08 schrieb Alexander Vázquez notifications@github.com:

Replace big_ol_pile_of_manim_imports import with manimlib.imports

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/3b1b/manim/issues/905?email_source=notifications&email_token=AOVSL4CWIYA4VKQHHHEJMWLRGH6JXA5CNFSM4LBHMX4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEODSOXQ#issuecomment-596059998, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOVSL4A4BUTDTVEWAE2MLVTRGH6JXANCNFSM4LBHMX4A.

www.Fraktales-Lernen.education Blog https://fraktales-lernen.education/category/blog/

MartinWy commented 4 years ago

I have given up, and bought a new Mac (it was time anyway) many thanks for your help