#๐ manim doing nothing
87 messages ยท Page 1 of 1 (latest)
@untold shale
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
linux btw
show your code
from manim import *
import numpy as np
class thing(Scene):
def construct(self):
a = Axes(x_range=[-10, 10], y_range=[-10, 10])
g = a.plot(lambda x: np.sin(x), color=BLUE)
self.add(a,g)
also, you don't call anything.
print("hello, world")```
thats normal
you need to call the code so it actually runs
prob troll
Think I've seen MEU before. Do not think a troll.
over 2300 messages
he's not a troll
i was copying the same way 3blue1brown do
he didnt call it
You'll have to supply some more detail.
probably you are
there is no other detail
he probably just didnt show it
he just run the code and it runs
but you need to call it
You have some code. You run it. It defines a class. And then does nothing with the class.
you can actualy search manim on youtube and search for the vid from 3blue1brown and you will se what i am talking about
Maybe you can show an example of the code from this 3blue1brown person?
All the code you cite above does is:
- import a heap of stuff from
manim - import
numpy - define a class, with one method
All of these "do" things, but none does anything very useful for you until you make use of that class you defined.
i did but it didnt pop window that have the animation
scrol on the top
... because you don't make an instance of the class and call its construct method.
idid
well i just did...
All I saw was this:
from manim import *
import numpy as np
class thing(Scene):
def construct(self):
a = Axes(x_range=[-10, 10], y_range=[-10, 10])
g = a.plot(lambda x: np.sin(x), color=BLUE)
self.add(a,g)
That doesn't run anything. It just imports stuff and defines a class. ..... for later use.
why for other it works!!?!?!??!?!!!
I have no idea, because you haven't shown use this other code.
You need an additional line or so, like this:
it = thing() # make an instance of thing
it.construct() # call the method
No. You didn't show any of that.
.....
...
huh...
where ill get the manim command?
..
By installing the manim package, which I assume you've done since the from manim import * line apparently works.
I pulled that staright from the PyPI page here:
https://pypi.org/project/manim/
which also has links to installation instructions and further documentation.
I've never used it. I'll look.
ill go deeper into reading that then
i was installing the optional dependencies...
I stuck your code in an meu.py file. Then:
python3 -m pip install manim
manim -p -ql meu.py thing
Running it did this:
[~/tmp/meu]fleet2*> manim -p -ql meu.py thing
Manim Community v0.18.1
[11/24/24 23:51:15] INFO scene_file_writer.py:737
File ready at '/Users/cameron/tmp/meu/media/images/meu/thing_ManimCE_v0.18.1.png'
INFO Rendered thing scene.py:247
Played 0 animations
[11/24/24 23:51:16] INFO Previewed File at: '/Users/cameron/tmp/meu/media/images/meu/thing_ManimCE_v0.18.1.png' file_ops.py:231
what is the -m is for?
And that png file contained the image above.
python3 -m pip invokes my local python3 to run the pip module. The install manim tells pip to install that package, and its dependencies.
hmmmm interesting ill try that
We do it that way to ensure that the package gets installing in the particular python environment used by python3.
That install makes a manim command also, which we then use.
I don't know what your environment is.
doesnt matter
There's a "Help with Manim" section on the PyPI page. It links to a discord and a reddit.
Likely. The manim command will be in the bin subdirectory of your venv, and "activate" arranges that that is in your command search path.
i fixed it by activating my env -_-
damn manim is cracking my pc to its max power
even with this simple stuff....
tho my laptop is super weak
This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.