I am attempting to write a Hello World program in Manim.
I have installed Manim and its prerequisite programs, and can run the sample code from the command prompt as intended. This sample code operates in an unusual way; the user issues a command specifying not only a .py file, but also a single class within it, and Python executes the class definition code, seemingly without instantiating the class.
Now I'm trying to write a standalone .py file that works by instantiating a class when run (I am running it in Visual Studio Community 2019), rather than requiring external commands.
I have checked many of the Similar Questions, but unfortunately, they are all about Hello World programs in general, even spanning many non-Python languages.
I found a few AttributeError: '____' object has no attribute '____' questions in search, including this helpful explanation (https://stackoverflow.com/a/8696339/2364796), but nothing that seems to apply to the code I've explicitly written.
I also checked in IRC, and it was suggested that the problem is triggered within the imported code. However, the same code functions properly when imported into the sample, so I must be working with it incorrectly.
This is the current code for my Hello World program.
from manimlib.imports import *
class GreetingScript(Scene):
def construct(self):
characters = TextMobject("Hello World!")
self.add(characters)
scene1 = Scene()
readthrough = GreetingScript(scene1)
This is the error message produced by the above code.
Media will be stored in ./media\. You can change this behavior by writing a
diff
erent directory to media_dir.txt.
Traceback (most recent call last):
File "C:\Users\Admin\Documents\Visual Studio
2019\Projects\PythonApplication1\
PythonApplication1\PythonApplication1.py", line 8, in <module>
scene1 = Scene()
File "C:\Users\Admin\PortableApps\manim-0.1.5\manimlib\scene\scene.py",
line 3
7, in __init__
self, **self.file_writer_config,
File "C:\Users\Admin\PortableApps\manim-
0.1.5\manimlib\scene\scene_file_writer
.py", line 44, in __init__
self.init_output_directories()
File "C:\Users\Admin\PortableApps\manim-
0.1.5\manimlib\scene\scene_file_writer
.py", line 49, in init_output_directories
output_directory = self.output_directory or
self.get_default_output_director
y()
File "C:\Users\Admin\PortableApps\manim-
0.1.5\manimlib\scene\scene_file_writer
.py", line 80, in get_default_output_directory
filename = os.path.basename(self.input_file_path)
AttributeError: 'SceneFileWriter' object has no attribute 'input_file_path'
Press any key to continue . . .
I would expect the output of the program to be a display of the text "Hello World!" but the actual output is AttributeError: 'SceneFileWriter' object has no attribute 'input_file_path' accompanied by the rest of the above message.