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

Doesn't work with Text object #13

Closed
qo4on opened this issue Feb 13, 2020 · 4 comments
Closed

Doesn't work with Text object #13

qo4on opened this issue Feb 13, 2020 · 4 comments

Comments

@qo4on
Copy link

qo4on commented Feb 13, 2020

%%manim Shapes --base64 --low_quality --verbose

class Demo(Scene):
  def construct(self):
    text = Text('Hello, world!')
    self.play(Write(text))

Media will be written to ./media/. You can change this behavior with the --media_dir flag.

/tmp/tmpgj01amj5.py:15: UserWarning: Import from notebook: name already in the globals(), skipping
warn('Import from notebook: ' + name + ' already in the globals(), skipping')

Shapes is not in the script

Traceback (most recent call last):
File "/content/manim/manimlib/extract_scene.py", line 155, in main
scene = SceneClass(**scene_kwargs)
File "/content/manim/manimlib/scene/scene.py", line 53, in init
self.construct()
File "/tmp/tmpgj01amj5.py", line 23, in construct
text = Text('Hello, world!')
TypeError: init() takes 1 positional argument but 2 were given

It works with command line:
!python3 -m manim example_scenes.py Demo -pl

@krassowski
Copy link
Owner

krassowski commented Feb 16, 2020

Shapes is not in the script

You are not rendering the Demo scene class, instead, you attempt to render a Shapes scene class.

%%manim Shapes --base64 --low_quality --verbose

should be

%%manim Demo --base64 --low_quality --verbose

@qo4on
Copy link
Author

qo4on commented Feb 16, 2020

I have a lot of examples (more than 100) where it works in this way.
image
Actually I didn't notice that I have to change Shapes. I changed the class... and didn't touch the first line every time. And there were no errors.
Can you explain why this is happening?

@qo4on
Copy link
Author

qo4on commented Feb 28, 2020

I found the issue. When I uninstall jupyter-manim and install it again the Text class becomes unreachable for the whole notebook.

@krassowski
Copy link
Owner

I am happy that you found the culprit. It seems that it is not an issue with this package. Please re-open if any action is needed.

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