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

running the example_scene.py #2050

Open
Ritvik-Buxi opened this issue Jul 29, 2023 · 6 comments
Open

running the example_scene.py #2050

Ritvik-Buxi opened this issue Jul 29, 2023 · 6 comments

Comments

@Ritvik-Buxi
Copy link

Describe the error

The Error Occurred when I was setting up the cloned repository of this one on 29th July 2023
I was using a virtual environment set up and it is NOT a conda virtual environment
I was running the file with this command
manimgl example_scenes.py TextExample

Code and Error

Code:
The Code is in this repository.
example_scene.py

Error:
ManimGL v1.6.1
[18:54:38] INFO Using the default configuration file, which you can modify in e:\ma\manim\manim_env\lib\site-packages\manimlib\default_config.yml config.py:265 INFO If you want to create a local configuration file, you can create a file named custom_config.yml, or run manimgl --config config.py:266 WARNING You may be using Windows platform and have not specified the path of temporary_storage, which may cause OSError. So it is recommended to specify config.py:232 the temporary_storage in the config file (.yml)
WARNING Unsupported element type: <class 'svgelements.svgelements.Use'> svg_mobject.py:174 WARNING Unsupported element type: <class 'svgelements.svgelements.Use'> svg_mobject.py:174 WARNING Unsupported element type: <class 'svgelements.svgelements.Use'> svg_mobject.py:174 WARNING Unsupported element type: <class 'svgelements.svgelements.Use'> svg_mobject.py:174 WARNING Unsupported element type: <class 'svgelements.svgelements.Use'> svg_mobject.py:174 WARNING Unsupported element type: <class 'svgelements.svgelements.Use'> svg_mobject.py:174E:\ma\manim\manim_env\lib\site-packages\manimlib\utils\space_ops.py:155: RuntimeWarning: invalid value encountered in scalar divide
cos_angle = np.dot(v1, v2) / np.float64(n1 * n2)
Traceback (most recent call last):
File "C:\Users\COMPUTER-22H2\miniconda3\lib\runpy.py", line 196, in _run_module_as_main
return run_code(code, main_globals, None,
File "C:\Users\COMPUTER-22H2\miniconda3\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "E:\ma\manim\manim_env\Scripts\manimgl.exe_main
.py", line 7, in
File "E:\ma\manim\manim_env\lib\site-packages\manimlib_main
.py", line 25, in main
scene.run()
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\scene\scene.py", line 91, in run
self.construct()
File "E:\ma\manim\example_scenes.py", line 119, in construct
text = Text("Here is a text", font="Consolas", font_size=90)
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\text_mobject.py", line 149, in init
super().init(text, **kwargs)
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\labelled_string.py", line 64, in init
super().init()
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 65, in init
self.init_svg_mobject()
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 76, in init_svg_mobject
self.generate_mobject()
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\labelled_string.py", line 79, in generate_mobject
super().generate_mobject()
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 102, in generate_mobject
mobjects = self.get_mobjects_from(svg)
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 156, in get_mobjects_from
mob = self.path_to_mobject(shape)
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 221, in path_to_mobject
return VMobjectFromSVGPath(path, **self.path_string_config)
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 301, in init
super().init(**kwargs)
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\types\vectorized_mobject.py", line 85, in init
super().init(**kwargs)
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\mobject.py", line 89, in init
self.init_points()
File "E:\ma\manim\manim_env\lib\site-packages\manimlib\mobject\svg\svg_mobject.py", line 324, in init_points
self.set_points(self.get_points_without_null_curves())
File "E:\ma\manim\manim_env\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 (126,3) (129,3)

Environment

OS System:
Windows
manim version:
ManimGL v1.6.1
Manim version is uhhh:
(manim_env) E:\ma\manim>manim -v
usage: manim [-h] [-p] [-w] [-s] [-l] [-m] [--high_quality] [-g] [-i] [-f] [-t] [-q] [-a] [-o FILE_NAME] [-n START_AT_ANIMATION_NUMBER] [-r RESOLUTION] [-c COLOR] [--sound]
[--leave_progress_bars] [--media_dir MEDIA_DIR] [--video_dir VIDEO_DIR | --video_output_dir VIDEO_OUTPUT_DIR] [--tex_dir TEX_DIR]
file [scene_names ...]
manim: error: the following arguments are required: file, scene_names

python version:
python 3.10.9

@Ritvik-Buxi
Copy link
Author

ValueError: operands could not be broadcast together with shapes (126,3) (129,3)
These Numbers Change When I try to render another file
like (24,3) (0,3)

@pdkary
Copy link

pdkary commented Aug 21, 2023

numpy<=1.24

@bagang52
Copy link

bagang52 commented Sep 9, 2023

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

apt-cache madison python3-numpy
python3-numpy | 1:1.24.2-1 | http://cn.archive.ubuntu.com/ubuntu lunar/main amd64 Packages

How can Numpy be downgraded to versions below 1.24?

@Jeffjewett27
Copy link

pip install numpy==1.24 worked for me

@shallow-beach
Copy link

shallow-beach commented Dec 16, 2023

after following all steps on the MacOS guide, i needed to use pyenv with pipenv to get a version of pip that would play nice with pip install numpy==1.24. my python distribution was acquired using pyenv install 3.8 which defaults to 3.8.18, and for some reason i needed to manually edit Pipfile and Pipfile.lock to use 3.8, as pipenv install wouldn't use the correct (local) python distribution.

some examples within example_scenes.py do not run, but some do. regardless all show:
WARNING Unsupported element type: <class 'svgelements.svgelements.Use'>
at runtime, typically along with a few other errors.

Here are the calls that fail before displaying anything:
TexTransformExample
TexIndexing
UpdatersExample

@JacobBumgarner
Copy link

pip install numpy==1.24 worked for me

I can confirm on WSL2 that installing numpy==1.24.0 fixed the shape operand issues with manimgl for me.

Thanks for figuring this one out.

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

6 participants