Skip to content

Conversation

@PhilipEnchin
Copy link
Contributor

List of Changes

  • Minor typo fix
  • Change installation (from source) command

Motivation

The provided installation command (python3 -m pip install -r requirements.txt) doesn't appear to work. The executable manim doesn't exist on the system after. The two commands I've provided do the trick.

Acknowledgement

Copy link
Member

@naveen521kk naveen521kk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems better to me.

@leotrs
Copy link
Contributor

leotrs commented Sep 2, 2020

Ah good catch! Yes the instructions are missing a step. Could you please try the command suggested by naveen521kk? That should work and should be the actual fix for the docs ;)

Co-authored-by: Naveen M K <naveen@syrusdark.website>
@PhilipEnchin
Copy link
Contributor Author

PhilipEnchin commented Sep 3, 2020

The suggestion by @naveen521kk is indeed better. There's also an alternate command that does the same job:

python3 setup.py install

I don't know that it's necessarily better or worse, but I thought I'd put it here in case @naveen521kk or @leotrs (or anyone else) has any opinion.

That aside, I dug a bit and went back to 3b1b's Manim where I got the two commands from my original suggestion (specifically from the Dockerfile). The install-from-repo instructions appear to be written not to install a system-wide manim command (as is the case in both this PR and this repo's installation documentation) but rather to allow for a user to hack away at Manim's codebase while keeping a stable, pip-installed library simultaneously.

If that were the intention here, the warning included in the installation instructions here wouldn't be needed. (It's also possible installing from the repo would overwrite a pip installation, but I need to check that...)

To summarize the commands for either situation...

  • A system-wide installation directly from this repo would use the command in this PR. In addition, requirements.txt would not be required anymore, unless...

  • An installation of the library's requirements, then using Manim without a system-wide installation would require the following commands, and would negate the warning currently included, but would require a file like 3b1b's manim.py (which may exist, but which I was unable to find in this repo).

python3 -m pip install -r requirements.txt # to install requirements
python3 ./[some file] example_scenes/basic.py SquareToCircle -pl # to run Manim

So... Which should be included here? System-wide installation instructions, or a hackable-alongside-a-stable-install installation instructions?

(Or both?)

@leotrs
Copy link
Contributor

leotrs commented Sep 3, 2020

I guess in general we would want to have both. OTOH, I feel like most people with enough experience to want to contribute and have a bleeding-edge version of manim installed (whether or not alongside a system-wide stable version) would have enough tech chops to do it themselves... maybe? Yes? No? I'm thinking out loud here.

On the other other hand, we are about to move to poetry and away from pip (#165 ), so I'm not entirely sure how relevant this is now. At the very least we should be discussing this in terms of poetry, not pip. cc @naveen521kk

@PhilipEnchin
Copy link
Contributor Author

To reply to my own message...

(It's also possible installing from the repo would overwrite a pip installation, but I need to check that...)

This doesn't appear to be the case, but it seems to work this way in the other direction.

Moving on...

I guess in general we would want to have both. OTOH, I feel like most people with enough experience to want to contribute and have a bleeding-edge version of manim installed (whether or not alongside a system-wide stable version) would have enough tech chops to do it themselves... maybe? Yes? No? I'm thinking out loud here.

My experience: I had been using the pip installed manimce, but after a bug fix, I'm relying on an installation directly from the repo until the published package is updated. I'm managing multiple installations by using Docker, which is a solution that works for me, but since Python is not my usual universe, I've been so far unable to install stuff from requirements.txt and then run Manim straight from the repo without installing it first. I can do it from 3b1b's repo, but not here. And I don't know enough to even know whether it's me or whether it's just complicated by the fact that the pieces that make that work in 3b1b's repo have been removed/moved/modified. So my perspective is that as someone with enough experience to contribute and want a bleeding-edge version of Manim can simultaneously not have the chops to use that version alongside a system-wide stable version.

On the other other hand, we are about to move to poetry and away from pip...

Perhaps you're right in that this maybe isn't the time to be talking about this particular point. Looks like I have some poetry reading ahead of me...

At this point, since the latest commit in this PR now has a command to install without requiring requirements.txt, can it be removed?

@leotrs
Copy link
Contributor

leotrs commented Sep 4, 2020

I've been so far unable to install stuff from requirements.txt and then run Manim straight from the repo without installing it first.

I'm not sure why you would want to do this. If you already have the source code, then "installing" it just means moving the files to the appropriate locations so that python can find it when you do python -m manim scene.py and your system can find it when you do manim -pl scene.py. Trying to run it without installing will generally cause python to not find the appropriate files (unless you have moved/linked them yourself, or if you are running manim from the actual directory where the source files are...)

So my perspective is that as someone with enough experience to contribute and want a bleeding-edge version of Manim can simultaneously not have the chops to use that version alongside a system-wide stable version.

I agree. I was being too quick to judge before. We should include installation instructions that work for (most of the common) uses cases, without assuming previous knowledge.

@PhilipEnchin
Copy link
Contributor Author

I've been so far unable to install stuff from requirements.txt and then run Manim straight from the repo without installing it first.

I'm not sure why you would want to do this. If you already have the source code, then "installing" it just means moving the files to the appropriate locations so that python can find it when you do python -m manim scene.py and your system can find it when you do manim -pl scene.py. Trying to run it without installing will generally cause python to not find the appropriate files (unless you have moved/linked them yourself, or if you are running manim from the actual directory where the source files are...)

For me, trying out Manim after making a change in the code means that it would be advantageous to try it out without installing it. That way I can keep using my installed version of Manim (via pip, or directly from the repo) to make beautiful videos, and run the modified version without having to install anything. If you have a look at 3b1b's instructions, you'll see that manim can be run straight from the repo without installing it on the system, using python3 ./manim.py .... So it doesn't affect the system-level manim installation at all.

Running the python3 -m pip install -r requirements.txt command takes care of installing the python dependencies that would otherwise be installed during a "proper" install with the python3 -m pip install . command.

Anyway, hopefully that provides some context as to the why. As far as how, I'm not sure. The file I mentioned in 3b1b's instructions doesn't exist in this repo anymore, and my Python skills aren't sufficient (at least tonight) to figure out what file would serve as an equivalent, or how to make an equivalent file myself. I've tried... :(

So my perspective is that as someone with enough experience to contribute and want a bleeding-edge version of Manim can simultaneously not have the chops to use that version alongside a system-wide stable version.

I agree. I was being too quick to judge before. We should include installation instructions that work for (most of the common) uses cases, without assuming previous knowledge.

All good. The installation command already commited in this PR does the trick for a system-level installation, so I'd suggest getting it merged if it's suitable enough for now and work on the rest* after.

* The rest being instructions for installing the requirements via requirements.txt and running Manim without installing the library itself.

@naveen521kk
Copy link
Member

Ok so now setup.py is gonna be removed in #165 so your method won't work. After it being removed you can do an editable installation using poetry which can be used to test with changing codes directly. For now you can do pip install -e . for editable installation.
I think requirements.txt is must for atleast Dev's.

@PhilipEnchin
Copy link
Contributor Author

Ok so now setup.py is gonna be removed in #165 so your method won't work. After it being removed you can do an editable installation using poetry which can be used to test with changing codes directly. For now you can do pip install -e . for editable installation.

Got it. Closed.

Thanks for the -e tip.

I think requirements.txt is must for atleast Dev's.

Pip installs catch all the requirements since they're listed in setup.py, and since I haven't been able to use it without actually installing it, I personally haven't needed it. Deleting the file has no effect on the ability to install with pip. In case that's helpful.

@leotrs
Copy link
Contributor

leotrs commented Sep 5, 2020

Yeah, I recommend you look into setting up virtual environments if you don't have those already.

I have a virtual environment with the latest (supposedly stable) version of manim-ce to make videos, and a different environment with my own fork which is ahead of manim-ce by a few commits. Both are installed with the -e flag so the changes I make are propagated instantly without having to install anything. And I can activate or deactivate either environment from anywhere in the system so I can use both at any time I want. I think this is a better way of having both side by side, rather than installing one and not installing the other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants