3b1b / videos

Code for the manim-generated scenes used in 3blue1brown videos
5.79k stars 1.55k forks source link

Error when trying to run InitialDemo scene #22

Closed cobase2010 closed 2 years ago

cobase2010 commented 2 years ago

I tried to run the following command similar to what I saw in the video and got the following error. Any idea what I need to do to fix it? The manimgl was installed from the latest community distribution manually but I tried pip install manimgl with the same issue. Just running "python _2022/wordle.py" is fine though.

manim) markyoung@macbook-pro-3 videos % manimgl _2022/wordle.py InitialDemo ManimGL v1.4.1 Traceback (most recent call last): File "/Users/markyoung/opt/anaconda3/envs/manim/bin/manimgl", line 33, in sys.exit(load_entry_point('manimgl', 'console_scripts', 'manimgl')()) File "/Users/markyoung/Projects/manim/manimlib/main.py", line 25, in main scene.run() File "/Users/markyoung/Projects/manim/manimlib/scene/scene.py", line 76, in run self.setup() File "_2022/wordle.py", line 1406, in setup super().setup() File "_2022/wordle.py", line 778, in setup self.add_guess_value_grid_title() File "_2022/wordle.py", line 805, in add_guess_value_grid_title underline.match_y(first.get_bottom() + 0.025 * DOWN) File "/Users/markyoung/Projects/manim/manimlib/mobject/mobject.py", line 1195, in match_y return self.match_coord(mobject, 1, direction) File "/Users/markyoung/Projects/manim/manimlib/mobject/mobject.py", line 1186, in match_coord mobject.get_coord(dim, direction), AttributeError: 'numpy.ndarray' object has no attribute 'get_coord'

SilverRapier commented 2 years ago

I don't know what the root cause is, but a workaround for me was to just comment out the underline.match_y line since it's just used for visual alignment and the program still works without it

cobase2010 commented 2 years ago

I did that too but then ran into another problem after entering the first guess and pattern. That's why I thought maybe it was related to what I had commented out.

mobject VGroup 1 [0. 0. 0.] Exception ignored on calling ctypes callback function: <function ObjCSubclass.method..decorator..objc_method at 0x7f84cff920d0>
Traceback (most recent call last): File "/Users/markyoung/opt/anaconda3/envs/manim/lib/python3.8/site-packages/pyglet/libs/darwin/cocoapy/runtime.py", line 1141, in objc_method result = f(py_self, args) File "/Users/markyoung/opt/anaconda3/envs/manim/lib/python3.8/site-packages/pyglet/window/cocoa/pygletview.py", line 199, in pygletKeyDown self._window.dispatch_event('on_key_press', symbol, modifiers) File "/Users/markyoung/opt/anaconda3/envs/manim/lib/python3.8/site-packages/pyglet/window/init.py", line 1352, in dispatch_event if EventDispatcher.dispatch_event(self, args) != False: File "/Users/markyoung/opt/anaconda3/envs/manim/lib/python3.8/site-packages/pyglet/event.py", line 408, in dispatch_event if handler(args): File "/Users/markyoung/Projects/manim/manimlib/window.py", line 106, in on_key_press self.scene.on_key_press(symbol, modifiers) File "_2022/wordle.py", line 1429, in on_key_press super().on_key_press(symbol, modifiers) File "_2022/wordle.py", line 1170, in on_key_press super().on_key_press(symbol, modifiers) File "_2022/wordle.py", line 752, in on_key_press self.reveal_pattern() File "_2022/wordle.py", line 1419, in reveal_pattern super().reveal_pattern(args, **kwargs) File "_2022/wordle.py", line 871, in reveal_pattern if self.presenter_mode: AttributeError: 'InitialDemo' object has no attribute 'presenter_mode'

abela14 commented 2 years ago

I had the same issue as you and followed the same solution. Once I received the presenter_mode error I just commented out the code block for if self.presenter_mode: as well and it worked fully

cobase2010 commented 2 years ago

When I commented that block out, the whole UI stopped receiving keyboard input. If I just commen out the "if self.presenter_mode:" and leave the rest, however, it doesn't generate exceptions but does not provide any recommended guesses. I can enter my own guesses but I'd like to see the recommended guesses and their E numbers.

@abela14, does yours work with recommended guesses on the screen after each input?

abela14 commented 2 years ago

Just wanted to preface, I guess, that I'm also not sure the root cause of the issue. But yes, mine does work with the recommended guesses. The only changes I made to wordle.py are the comment to underline.match_y and if self.presenter_mode:

image

cobase2010 commented 2 years ago

Nice! I guess there was something wrong with my installation of prerequesites then. Anyway, I hacked a console program to get essential the same information presented so I am good for now.

cobase2010 commented 2 years ago

I was able to get it working after commenting out those offending lines. Just need to make sure that I click outside of the window first before entering information.