3b1b / manim

Animation engine for explanatory math videos
MIT License
70.79k stars 6.23k forks source link

ValueError: operands could not be broadcast together with shapes (24,3) (0,3) #2053

Open jianzhihuicui opened 1 year ago

jianzhihuicui commented 1 year ago

Describe the error

I had installed manimgl according to the documents written by three Blue one Brown in his website.

Code and Error

from manimlib.imports import *

class SquareToCircle(Scene): def construct(self): circle = Circle() circle.set_fill(BLUE, opacity=0.5) circle.set_stroke(BLUE_E, width=4) square = Square()

    self.play(ShowCreation(square))
    self.wait(3)
    self.play(ReplacementTransform(square, circle))
    self.wait(3)

Error:

Traceback (most recent call last): File "C:\Users\Asus\Python3.9\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Asus\Python3.9\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "C:\Users\Asus\Python3.9\Scripts\manimgl.exe__main.py", line 7, in File "C:\Users\Asus\Python3.9\lib\site-packages\manimlib__main__.py", line 25, in main scene.run() File "C:\Users\Asus\Python3.9\lib\site-packages\manimlib\scene\scene.py", line 91, in run self.construct() File "new_1.py", line 15, in construct circle = Circle() File "C:\Users\Asus\Python3.9\lib\site-packages\manimlib\mobject\geometry.py", line 324, in init Arc.init(self, 0, TAU, **kwargs) File "C:\Users\Asus\Python3.9\lib\site-packages\manimlib\mobject\geometry.py", line 218, in init VMobject.init__(self, kwargs) File "C:\Users\Asus\Python3.9\lib\site-packages\manimlib\mobject\types\vectorized_mobject.py", line 85, in init super().init(kwargs) File "C:\Users\Asus\Python3.9\lib\site-packages\manimlib\mobject\mobject.py", line 89, in init self.init_points() File "C:\Users\Asus\Python3.9\lib\site-packages\manimlib\mobject\geometry.py", line 221, in init_points self.set_points(Arc.create_quadratic_bezier_points( File "C:\Users\Asus\Python3.9\lib\site-packages\manimlib\mobject\types\vectorized_mobject.py", line 968, in wrapper if not np.all(self.get_points() == old_points): ValueError: operands could not be broadcast together with shapes (24,3) (0,3)

Environment

OS System: manim version: master image v1.6.1(in python3.9)but when I using python39 -m manimgl -version returns nothing! python version: i have python3.7.8 and python3.9 both install manim or manimgl (right sequence)

help!!!

bagang52 commented 1 year ago

I had a same error... OS System: Ubuntu 23.04 Codename: lunar manim version: ManimGL v1.6.1 python version: Python 3.11. numpy version: 1.24.2

bagang52 commented 1 year ago

numpy<=1.24

Sirri69 commented 1 year ago

Also facing the same issue, any updates on this?

jianzhihuicui commented 1 year ago

from manim import * because of the update, I recommend a more simple instrument suggestion. no "showcreation", only "create"

jianzhihuicui commented 1 year ago

Also facing the same issue, any updates on this?

refer to the website then update the instrument. that is ok. hope more communication.

RichardSrn commented 11 months ago

Using numpy==1.24 seems to solve the issue.

thesophile commented 11 months ago

switch to numpy 1.24 using pip3 install numpy==1.24