Installation

Important

JAnim is an animation library that runs on Python 3.12 and higher. Creating animations with JAnim requires writing Python programs, so users need to have some understanding of programming

Steps

Installing JAnim

When installing JAnim, external dependencies are not required, so we can install JAnim directly and install dependencies as needed.

Developers familiar with Python libraries can choose appropriate installation methods. Overall, there are two installation approaches, each with advantages:

  • Installing globally allows all projects to use the same library, and commands can be called directly without switching environments and directories first;

  • Installing in a virtual environment provides dependency isolation between projects and does not pollute global commands.

Since subsequent operations will more or less involve command-line operations, we hope you have some understanding of the command line

Click to expand brief instructions on opening the command line

Here we briefly introduce how to open the command line, and will not mention it again later. On Windows, it is recommended to use the built-in PowerShell. ❶ A simple way to open it is to press “Win logo key + R” to open the “Run” window, enter powershell (PowerShell 7.x requires entering pwsh), ❷ you can also enter “powershell” in the Start menu and press Enter, or ❸ press ctrl + ` in VS Code. On macOS / Linux, generally right-click to select “Terminal” or find the built-in terminal icon.

The following briefly introduces several common installation methods:

uv is a toolchain for Python project management, currently relatively mature, and convenient for developers who frequently use multiple Python versions and multiple dependency libraries. The official provides many installation methods, which can be installed using the package managers mentioned above, or installed independently.

Note

This entry borrows from the ManimCE project’s installation documentation, command-line installation of uv and further commands for creating new projects can refer to the corresponding paragraphs therein.

If you are not yet familiar with using uv and are slightly confused, you can click on the “Python + Global” tab above to switch to a more classic installation method, which you may find easier to understand, but we still recommend using uv for management.

This section introduces how to create independent virtual environments under each folder. If you are at an appropriate file path (referred to as /my/path below) and want to develop in a folder called “JAnim-folder”, please run the following commands line by line, which will automatically create “JAnim-folder” and create a virtual environment in it.

cd "/my/path"
uv init "JAnim-folder"
cd "JAnim-folder"
uv add janim[gui]
uv run janim --version  # If you see the version number, the installation is complete

After installing in this way, all janim commands in the documentation should be replaced with uv run janim. If you still want to call janim directly, you need to first activate the virtual environment, which is for the purpose of isolating global and project-specific environments.

Tip

Once everything is ready, you can use uv run janim examples to view built-in examples and further verify the JAnim installation

Installing Optional Dependencies

  • To output video files or process audio/video, you need to install FFmpeg.

    However, it is worth noting that previewing animations via the GUI does not depend on FFmpeg; it is only required when finally exporting video. Therefore, you can start experimenting with JAnim right away and install FFmpeg later when you need to render output.

  • For typesetting formulas or advanced text formatting, JAnim uses Typst.

    Typst is already integrated into JAnim (via the typst-py package), so no additional installation is required. However, if you prefer to use an external Typst executable, instructions for doing so are provided below.

  • For Linux, you may also need to install portaudio19-dev additionally. For details, see the Linux section below.

Package management on Windows systems is not necessarily ready to use out of the box. It usually requires some familiarity with command-line operations and a small amount of configuration. This configuration process is relatively time-consuming, but once configured, it can automatically handle many trivial tasks. The author recommends using a package manager here.

There are many choices for package managers. Generally, Windows should come with Winget built-in. You can also use Chocolatey or Scoop. You only need to install one of the three, though installing multiple won’t cause conflicts.

After installing the package manager (or using the built-in Winget), taking Winget as an example, press Win + R and enter powershell, or enter powershell in the Start menu to open PowerShell, then enter winget install typst and winget install ffmpeg to complete the installation. The other two are similar.

Tip

If you are not familiar with the command line and prefer a graphical interface, you can also install UniGetUI to provide a unified display and invocation of package managers. Note that it is only a graphical interface for package managers and still requires the corresponding package manager to exist in the environment to use.

Possible Issues

Microsoft Visual C++ 14.0 or greater is required.

During installation, the glcontext package shows the following error:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools":
https://visualstudio.microsoft.com/visual-cpp-build-tools/

Simply follow the link it provides https://visualstudio.microsoft.com/visual-cpp-build-tools/ to download and install.

When installing components, check “Desktop development with C++” and click the install button, as shown in the figure below

_images/VCpp.png

After installation is complete, try installing JAnim again.

If it still fails, you can try restarting the terminal, editor, or computer and try again.

Installing VS Code

It is recommended to use VS Code for development, which allows the janim-toolbox plugin to make using JAnim more convenient

For details, refer to the introduction in VS Code Extension


Tip

Please click the button at the bottom right of the page to proceed to the next section. This reminder will not appear in subsequent sections.