3b1b / manim

Animation engine for explanatory math videos
MIT License
62.99k stars 5.83k forks source link

Unable to open example_scenes.py SquareToCircle #156

Closed ghost closed 5 years ago

ghost commented 6 years ago

Hi, I'm getting the following error message

capture

Can someone help me figure out what's wrong?

jacobhelbig commented 6 years ago

Are both extract_scene.py and example_scenes.py where they belong? And is the class SquareToCircle the way it should be?

ghost commented 6 years ago

They're in the manim-master folder. Should they not be? I downloaded the files for using manim yesterday, and I followed the instruction on how to open a scene, but the error message appears.

zimmermant commented 6 years ago

I'm having the same issue too.

jacobhelbig commented 6 years ago

No, they should be in the root folder - Maybe something with your constants.py isn't correct, so it can't figure out what file to look for? Also: what is Anaconda2? It seems to be interfering with manim... (the last 2 error messages) that‘s probably it.

ghost commented 6 years ago

Anaconda2 is the Python distribution that I'm using. I have both Python 2 and Python 3 on my computer since Python 3 isn't backwards compatible. I use the command py for Python 2.7 and python for Python 3.6.

Anyways, how do I edit the constants.py so that it can look for the files in the manim-master folder? I don't want to clutter up my root directory.

ghost commented 6 years ago

Actually, I'm pretty sure that running the command py extract_scene.py example_scenes.py SquareToCircle -p that it's able to find the extract_scene.py and example_scenes.py files just fine, since if I instead write py fake_file.py then I get a different error message.

ghost commented 6 years ago

One thing that I've tried that seems to do something (but doesn't resolve the issue completely) is replacing line 606 self.writing_process = sp.Popen(command, stdin=sp.PIPE) with self.writing_process = sp.Popen(command, stdin=sp.PIPE, shell=True) in the scene.py file.

vors commented 6 years ago

@zhangwn What's the error with shell=True?

ghost commented 6 years ago
capture

It's basically the same, but this time it at least succeeds in creating the SquareToCircle.mp4, although that video only shows a black screen.

vors commented 6 years ago

It's basically the same

It's actually quite different: this second error comes just from the inability to open the mp4 file after it's written with open command (macOS specific). So the real issue is the black screen...

ghost commented 6 years ago

So, does that mean that the manim project wasn't intended to be compatible with Windows if it's relying on macOS specific commands? How would I fix the second error message?

vors commented 6 years ago

From my very limited experience in #162 it seems that some additional massaging needed for both Windows and Linux (you actually got further in Windows path then I did :D ). I don't think there are any fundamental problems since python is in most cases behave pretty reasonable in a cross-platform manner.

@3b1b can you shade some light on the current platforms where it should / known to work?

iammosespaulr commented 6 years ago

@3b1b I get the same error too ... Im in Ubuntu 17 btw ,

Writing to /home/cyborg/manim/videos/animations/example_scenes/1080p60/SquareToCircleTemp.mp4

Traceback (most recent call last):
  File "extract_scene.py", line 253, in main
    handle_scene(SceneClass(**scene_kwargs), **config)
  File "/home/cyborg/manim/scene/scene.py", line 65, in __init__
    self.open_movie_pipe()
  File "/home/cyborg/manim/scene/scene.py", line 606, in open_movie_pipe
    self.writing_process = sp.Popen(command, stdin=sp.PIPE)
  File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1025, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

sh: 1: play: not found
MedNait commented 6 years ago

I tried installing manim on windows 10 and on ubuntu 16.04 without success, getting in the end, the apparently now famous, black screen issue. Different issues arise for each OS. For ubuntu, I was able to solve the following:

MedNait commented 6 years ago

I was able to get around the black screen issue and other issues (open command for e.g.) and get SquareToCircle scene to work. My comment on issue #173 might be helpful.

Disclaimer: This worked for me on Windows.

eulertour commented 5 years ago

Closing, as this problem was solved by #202.