Skip to content

Install from Source

For development against a checkout. Use Python 3.11–3.13 and Node.js 22 LTS to match CI and Docker.

Terminal window
git clone https://github.com/HKUDS/DeepTutor.git
cd DeepTutor
# Create a venv (macOS / Linux)
# Windows PowerShell:
# py -3.11 -m venv .venv ; .\.venv\Scripts\Activate.ps1
python3 -m venv .venv && source .venv/bin/activate
python -m pip install --upgrade pip
# Install backend + frontend deps
python -m pip install -e .
( cd web && npm ci --legacy-peer-deps )
deeptutor init
deeptutor start

Source installs run Next.js in dev mode against the local web/ directory; everything else (config layout, ports, stop with Ctrl+C) matches the PyPI install.

Terminal window
conda create -n deeptutor python=3.11
conda activate deeptutor
python -m pip install --upgrade pip
# ...then continue with `pip install -e .` and `npm ci`

pyproject.toml exposes layered extras:

Terminal window
pip install -e ".[dev]" # tests / lint tools
pip install -e ".[partners]" # all Partner channel SDKs (incl. wecom-aibot-sdk) + MCP client
pip install -e ".[matrix]" # Matrix channel without E2EE / libolm
pip install -e ".[matrix-e2e]" # Matrix E2EE; requires libolm
pip install -e ".[math-animator]" # Manim addon; requires LaTeX / ffmpeg / system libs

Compose them: pip install -e ".[dev,partners,math-animator]".

Full list — each extra has a requirements/*.txt mirror for Docker/CI builds where the source tree isn’t available yet:

ExtraWhat it addsRequirements mirror
cliCompatibility extra — CLI deps, already included in the default installrequirements/cli.txt
serverCompatibility extra — FastAPI server deps, already included in the default installrequirements/server.txt
partnersEvery built-in Partner channel SDK (wecom-aibot-sdk, qq-botpy, slack-sdk, lark-oapi, python-telegram-bot, dingtalk-stream, …) + MCP clientrequirements/partners.txt
tutorbotLegacy alias for partners, kept for one release
matrixMatrix (Element) channel, non-E2EE — works without libolmrequirements/matrix.txt
matrix-e2eMatrix E2EE add-on — needs the system libolm libraryrequirements/matrix-e2e.txt
math-animatorManim addon — needs LaTeX, pkg-config, cairo, cmake, ffmpegrequirements/math-animator.txt
devpytest / pre-commit / lint & security toolingrequirements/dev.txt
allpartners + matrix + math-animator + dev (E2EE not included)
ExtraSystem library
matrix-e2elibolm: brew install libolm (macOS) / sudo apt install libolm-dev (Debian)
math-animatorLaTeX + ffmpeg: brew install --cask mactex && brew install ffmpeg (macOS) / sudo apt install texlive-full ffmpeg (Linux)

When you add or upgrade a frontend dependency:

Terminal window
cd web
npm install --legacy-peer-deps
# commit both web/package.json and web/package-lock.json

Stuck dev server: if deeptutor start reports an existing frontend that isn’t responding, stop the PID it prints. If no Next.js process is actually running, the lock files are stale — remove them and retry:

Terminal window
rm -f web/.next/dev/lock web/.next/lock
deeptutor start

The backend supports --reload. Start backend and frontend in separate terminals for the best dev loop:

Terminal window
# Terminal A — backend with hot reload
python -m uvicorn deeptutor.api.main:app \
--host 0.0.0.0 --port 8001 \
--reload --reload-exclude "web/*" --reload-exclude "data/*"
# Terminal B — frontend dev server
cd web && npm run dev -- -p 3782
Terminal window
git pull
pip install -e . --upgrade
cd web && npm ci --legacy-peer-deps

If a release bumped settings schema, also re-run deeptutor init to fill in newly-introduced fields. Existing config is preserved.

error: Microsoft Visual C++ 14.0 is required (Windows)

Section titled “error: Microsoft Visual C++ 14.0 is required (Windows)”

Some Python deps compile C extensions. Install Build Tools for Visual Studio with “Desktop development with C++”.

libolm not found (when matrix-e2e is installed)

Section titled “libolm not found (when matrix-e2e is installed)”
Terminal window
brew install libolm # macOS
sudo apt install libolm-dev # Debian / Ubuntu
pip install -e ".[matrix-e2e]" --force-reinstall
Terminal window
npm config set fetch-timeout 600000
cd web && npm ci --legacy-peer-deps

You forgot the --reload-exclude flags. Restart with:

Terminal window
python -m uvicorn deeptutor.api.main:app \
--host 0.0.0.0 --port 8001 \
--reload --reload-exclude "web/*" --reload-exclude "data/*"

More fixes: Troubleshooting.