I’m trying to run this example from Manim community documentation:
JavaScript
x
7
1
from manim import *
2
3
class HelloWorld(Scene):
4
def construct(self):
5
text = Text('Hello world').scale(3)
6
self.add(text)
7
For some reason I’m getting this error:
JavaScript
1
2
1
TypeError: __init__() got an unexpected keyword argument 'color'
2
I’m using the latest version of Manim community (0.14.0)
What am I doing wrong?
The full output is:
JavaScript
1
70
70
1
(Python3.9) C:UsersUserIdeaProjectsGraphConnectivityDemo>manim -pql scene.py HelloWorld
2
Manim Community v0.14.0
3
╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
4
│ │
5
│ C:UsersUserPython3.9libsite-packagesmanimclirendercommands.py:139 in render │
6
│ │
7
│ 136 │ │ for SceneClass in scene_classes_from_file(file): │
8
│ 137 │ │ │ try: │
9
│ 138 │ │ │ │ scene = SceneClass() │
10
│ ❱ 139 │ │ │ │ scene.render() │
11
│ 140 │ │ │ except Exception: │
12
│ 141 │ │ │ │ error_console.print_exception() │
13
│ 142 │ │ │ │ sys.exit(1) │
14
│ C:UsersUserPython3.9libsite-packagesmanimscenescene.py:219 in render │
15
│ │
16
│ 216 │ │ """ │
17
│ 217 │ │ self.setup() │
18
│ 218 │ │ try: │
19
│ ❱ 219 │ │ │ self.construct() │
20
│ 220 │ │ except EndSceneEarlyException: │
21
│ 221 │ │ │ pass │
22
│ 222 │ │ except RerunSceneException as e: │
23
│ │
24
│ C:UsersUserIdeaProjectsGraphConnectivityDemoscene.py:5 in construct │
25
│ │
26
│ 2 │
27
│ 3 class HelloWorld(Scene): │
28
│ 4 │ def construct(self): │
29
│ ❱ 5 │ │ text = Text('Hello world').scale(3) │
30
│ 6 │ │ self.add(text) │
31
│ 7 │
32
│ │
33
│ C:UsersUserPython3.9libsite-packagesmanimmobjectsvgtext_mobject.py:472 in __init__ │
34
│ │
35
│ 469 │ │ │ ) │
36
│ 470 │ │ else: │
37
│ 471 │ │ │ self.line_spacing = self._font_size + self._font_size * self.line_spacing │
38
│ ❱ 472 │ │ file_name = self.text2svg() │
39
│ 473 │ │ PangoUtils.remove_last_M(file_name) │
40
│ 474 │ │ super().__init__( │
41
│ 475 │ │ │ file_name, │
42
│ │
43
│ C:UsersUserPython3.9libsite-packagesmanimmobjectsvgtext_mobject.py:753 in text2svg │
44
│ │
45
│ 750 │ │ if os.path.exists(file_name): │
46
│ 751 │ │ │ svg_file = file_name │
47
│ 752 │ │ else: │
48
│ ❱ 753 │ │ │ settings = self.text2settings() │
49
│ 754 │ │ │ width = config["pixel_width"] │
50
│ 755 │ │ │ height = config["pixel_height"] │
51
│ 756 │
52
│ │
53
│ C:UsersUserPython3.9libsite-packagesmanimmobjectsvgtext_mobject.py:714 in text2settings │
54
│ │
55
│ 711 │ │ │ │ temp_settings.append(TextSetting(start, setting.start, **setting_args)) │
56
│ 712 │ │ │ start = setting.end │
57
│ 713 │ │ if start != len(self.text): │
58
│ ❱ 714 │ │ │ temp_settings.append(TextSetting(start, len(self.text), **setting_args)) │
59
│ 715 │ │ settings = sorted(temp_settings, key=lambda setting: setting.start) │
60
│ 716 │ │ │
61
│ 717 │ │ if re.search(r"n", self.text): │
62
│ │
63
│ C:UsersUserIdeaProjectsGraphConnectivityDemocmanimpango.pyx:9 in │
64
│ manimpango.cmanimpango.TextSetting.__init__ │
65
│ │
66
│ [Errno 2] No such file or directory: │
67
│ 'C:\Users\User\IdeaProjects\GraphConnectivityDemo\cmanimpango.pyx' │
68
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
69
TypeError: __init__() got an unexpected keyword argument 'color'
70
Advertisement
Answer
You could try to upgrade manimpango via pip install -U manimpango
. As a workaround, using Tex
instead would also work as long as you have LaTeX installed.