Files
manim-slides/docs/source/installation.md
Jérome Eertmans 16f740d2ad chore(deps): make Qt backend optional (#350)
* chore(deps): make Qt backend optional

TODO:
- [ ] Add relevant entry in CHANGELOG
- [ ] Update install documentation
- [ ] Make sure `manim-slides convert` can run without any Qt backend
- [ ] Make sure test suite works (partially) without any Qt backend
- [ ] Make sure we can import `manim_slides` without any Qt backend

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* chore(deps): some fixes but wip

* chore(docs): update

* chore(deps): support PyQt6

* chore(deps): make Qt backend optional

TODO:
- [ ] Add relevant entry in CHANGELOG
- [ ] Update install documentation
- [ ] Make sure `manim-slides convert` can run without any Qt backend
- [ ] Make sure test suite works (partially) without any Qt backend
- [ ] Make sure we can import `manim_slides` without any Qt backend

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* chore(deps): some fixes but wip

* chore(docs): update

* chore(deps): support PyQt6

* fix(deps): ci and docs

* fix(lib): missing package

* chore(ci): does it work?

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* chore(test): skip failing

* chore(docs): update

* chore(docs): update

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix(docs): typo

* fix(test): quit instead of shutdown

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-01-26 15:08:23 +01:00

5.1 KiB

Installation

While installing Manim Slides and its dependencies on your global Python is fine, we recommend using a virtual environment (e.g., venv) for a local installation.

Therefore, the following documentation will install Manim Slides using pipx. This tool is a drop-in replacement for installing Python packages that ship with one or more executable.

The benefit of using pipx is that it will automatically create a new virtual environment for every package you install.

:::{note} Everytime you read pipx install, you can use pip install instead, if you are working in a virtual environment or else. :::

Dependencies

Manim Slides requires either Manim or ManimGL to be installed, along with their dependencies. Having both packages installed is fine too.

If none of those packages are installed, please refer to their specific installation guidelines:

:::{warning} If you install Manim from its git repository, as suggested by ManimGL, make sure to first check out a supported version (e.g., git checkout tags/v1.6.1 for ManimGL), otherwise it might install an unsupported version of Manim! See #314.

Also, note that ManimGL uses outdated dependencies, and may not work out-of-the-box. One example is NumPy: ManimGL does not specify any restriction on this package, but only numpy<1.25 will work, see #2053. :::

Pip Install

The recommended way to install the latest release with all features is to use pipx:

pipx install -U "manim-slides[pyside6-full]"

:::{tip} While not necessary, the -U indicates that we would like to upgrade to the latest version available, if Manim Slides is already installed. :::

:::{note} The quotes " are added because not all shell support unquoted brackets (e.g., zsh) or commas (e.g., Windows). :::

You can check that Manim Slides was correctly installed with:

manim-slides --version

Custom install

If you want more control on what dependencies are installed, you can always install the bare minimal dependencies with:

pipx install -U manim-slides

And install additional dependencies later.

Optionally, you can also install Manim or ManimGL using extras1:

pipx install -U "manim-slides[manim]"   # For Manim
# or
pipx install -U "manim-slides[manimgl]" # For ManimGL

For optional dependencies documentation, see next section.

:::{warning} If you are installing with pipx, this is mandatory to at least include either manim or manimgl. :::

Optional dependencies

Along with the optional dependencies for Manim and ManimGL, Manim Slides offers additional extras, that can be activated using optional dependencies:

  • full, to include magic, manim, manimgl, and sphinx-directive extras (see below);
  • magic, to include a Jupyter magic to render animations inside notebooks. This automatically installs manim, and does not work with ManimGL;
  • manim and manimgl, for installing the corresponding dependencies;
  • pyqt6 to include PyQt6 Qt bindings. Those bindings are available on most platforms and Python version, but produce a weird black screen between slide with manim-slides present, see #QTBUG-118501;
  • pyqt6-full to include full and pyqt6;
  • pyside6 to include PySide6 Qt bindings. Those bindings are available on most platforms and Python version, except on Python 3.122;
  • pyside6-full to include full and pyside6;
  • sphinx-directive, to generate presentation inside your Sphinx documentation. This automatically installs manim, and does not work with ManimGL.

Installing those extras can be done with the following syntax:

pipx install -U "manim-slides[extra1,extra2]"

When you need a Qt backend

Before v5.1, Manim Slides automatically included PySide6 as a Qt backend. As only manim-slides present and manim-slides wizard command need a graphical library, and installing PySide6 on all platforms and Python version can be sometimes complicated, Manim Slides chooses not to include any Qt backend.

The use can choose between PySide6 (best) and PyQt6, depending on their availability and licensing rules.

As of v5.1, you need to have Qt bindings installed to use manim-slides present or manim-slides wizard. The recommended way to install those are via optional dependencies, as explained above.

Install from source

An alternative way to install Manim Slides is to clone the git repository, and build the package from source. Read the contributing guide to know how to process.


  1. You still need to have Manim or ManimGL platform-specific dependencies installed on your computer. ↩︎

  2. Actually, PySide6 can be installed on Python 3.12, but you will then observe the same visual bug as with PyQt6. ↩︎