Rickaym / manim-sideview

A Manim utility extension for Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=Rickaym.manim-sideview
MIT License
102 stars 11 forks source link

You need a valid Python file to run the sideview? #23

Closed carveybunt closed 2 years ago

carveybunt commented 2 years ago

Why I get the error You need a valid Python file to run the sideview,. I installed the manim already.

mac: 12.5 python: 3.8

Rickaym commented 2 years ago

This usually happens when you try to run manim-sideview without a Python file opened as an active editor.

Make sure to select your python, and then press the run.

With Regards, Ricky.

carveybunt commented 2 years ago

@Rickaym Thanks, but I still don't get it. I already created a file of python:

from manim import *

class SquareAndCircle(Scene):
    def construct(self):
        text = Text("test")
        self.play(write(text))
        self.wait(3)
Rickaym commented 2 years ago

Can you please tell me how you're running the file?

Code Issue: Where is thewrite function coming from? Use something like Create if you would like to write onto the scene.

from manim import *

class SquareAndCircle(Scene):
    def construct(self):
        text = Text("test")
        self.play(Create(text))
        self.wait(3)

The code issue is not concerned with the error, just a sidenote.

With Regards, Ricky.

carveybunt commented 2 years ago

Thank you very much again.

My vscode setting: 截屏2022-08-17 19 54 30

My code file: 截屏2022-08-17 19 57 20

I ran the file by the following method: 截屏2022-08-17 19 57 55

Nothing happened when I click SquareAndCircle.

At the same times, I got the error ModuleNotFoundError: No module named 'manim' when I run python file by the following method: 截屏2022-08-17 20 05 46

My manim info: 截屏2022-08-17 20 10 58

Rickaym commented 2 years ago

Ah. I see. Does calling manim in your terminal function properly?

One alternative is to try specifying the direct location to the manim executable like down below: image

I'm not sure where the executable is stored on MacOS but it should be somewhere inside /Users/carveybunt/Library/Python/3.8/

No problem! Ricky.

carveybunt commented 2 years ago

Thanks again, I solved the problem. My absolute path to the manim executable is /Users/carveybunt/Library/Python/3.8/bin/manim. It working now, but the plugins threw the error Hey! You need a valid Python file to run the sideview.. This is a bug? In fact, I have set it like this, but because of this error, I did not execute the file.

Rickaym commented 2 years ago

Before it threw the error, does it allow you to pick a scene name? Could you also please provide a log for the manim terminal output (see screenshot below)?

I'm unable to recreate the issue on my end: image

Ricky.

carveybunt commented 2 years ago

Since I had the error, I thought this wrong path so I never picked any scene name. But the path is right.

Rickaym commented 2 years ago

Since I had the error, I thought this wrong path so I never picked any scene name. But the path is right.

Right, does it work when you pick a scene name? If it doesn't, could you please show me the log as previously requested?

Ricky.

carveybunt commented 2 years ago

It's working now, thanks again. I will close this issue now. 截屏2022-08-17 20 58 10

Rickaym commented 2 years ago

No Problem. Ricky.