Skip to content
Arkueid edited this page Sep 28, 2026 · 1 revision

Dependencies

  • cmake (>= 3.26)
  • gcc / msvc (C++17)
  • Python >= 3.11 (with the Development component)
    • Windows: keep the default options when installing Python (development files ship with the installer)
    • Linux: e.g. on Debian sudo apt install python3-dev
  • OpenGL environment
    • Windows: usually no configuration needed
    • Linux: install the corresponding dev dependencies, e.g. on Debian sudo apt install libgl1-mesa-dev libglu1-mesa-dev

The Cubism Core and Framework are included in this repository (the Live2D/ directory) — no separate download needed.

Get the Source

git clone --recursive git@github.com:EasyLive2D/live2d-py.git

(--recursive pulls the submodules; they are only needed for running tests, not for building the Python library)

Build from the Command Line

Windows (MSVC)

cmake -S . -B build -G "Visual Studio 18 2026" -T host=x64 -A x64
cmake --build build --config Release --target Live2DWrapper -j 24

When using another Visual Studio version, replace Visual Studio 18 2026 with the matching generator (e.g. Visual Studio 17 2022).

The build output _live2d.pyd is automatically copied to package/live2d/; use that directory as the Python module.

Linux / macOS

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --target Live2DWrapper -j

Build with VS Code (Windows)

  1. Install Visual Studio Code and Visual Studio (check the "Desktop development with C++" workload)
  2. Open this repository with Visual Studio Code
    code live2d-py
  3. Install the VS Code extensions: C/C++, CMake, CMake Tools
  4. Press Ctrl + Shift + P to open the command palette and select CMake: Configure (pick your Visual Studio as the Kit, Release as the Variant, and the x64 architecture)
  5. In the CMake view (bottom status bar), select the Live2DWrapper build target and click build
  6. When finished, the output file is package/live2d/_live2d.pyd

Python Environment Configuration

Python is located in the following order during the build (3.11+ with the Development component required):

  1. Environment variable PYTHON_INSTALLATION_PATH (explicit Python installation directory, highest priority)
  2. Windows registry (standard python.org installation)
  3. Python found on PATH

To pin a specific Python version:

set PYTHON_INSTALLATION_PATH=D:/Python312   # Windows
export PYTHON_INSTALLATION_PATH=/usr/local  # Linux

Debug Options

# Enable internal v2cpp debug output (Debug.hpp, fprintf to stderr)
cmake -DV2CPP_DEBUG=ON -S . -B build

For Cubism 2.0 Models

Cubism 2.1 models are implemented as a C++ port (v2cpp), already merged into the unified live2d.Model and built together with the Live2DWrapper target — no extra steps required.

The pure-Python live2d.v2 is deprecated (no build needed, but slower; use live2d.Model instead).

Clone this wiki locally