Skip to content

DeepTutor: Lifelong Personalized Tutoring. https://deeptutor.info/.

fix: missing pip

Bingxi Zhao (Frank)162a3f9dc46c
diff --git a/AGENTS.md b/AGENTS.md
index 6b2091678..1e5996e2d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -59,7 +59,7 @@ Extended features in `deeptutor/plugins/`:
```bash
# Install CLI
-pip install -r requirements/cli.txt && pip install -e .
+pip install -e ".[cli]"
# Run any capability (agent-first entry point)
deeptutor run chat "Explain Fourier transform"
@@ -78,7 +78,7 @@ deeptutor kb create my-kb --doc textbook.pdf
deeptutor plugin list
deeptutor memory show
-# API server (requires server.txt)
+# API server (requires .[server])
deeptutor serve --port 8001
```
@@ -141,9 +141,14 @@ class MyPlugin(BaseCapability):
## Dependency Layers
+Defined in `pyproject.toml` `[project.optional-dependencies]`. Mirrored as flat
+lists in `requirements/*.txt` for Docker/CI installs without source code.
+
```
-requirements/cli.txt — CLI full (LLM + RAG + providers + tools)
-requirements/server.txt — CLI + FastAPI/uvicorn (for Web/API)
-requirements/math-animator.txt — Manim addon (for `deeptutor animate`)
-requirements/dev.txt — Server + test/lint tools
+.[cli] — CLI full (LLM + RAG + providers + document parsing)
+.[server] — .[cli] + FastAPI/uvicorn (for Web/API)
+.[tutorbot] — .[server] + TutorBot agent engine + channel SDKs
+.[math-animator] — Manim addon (for `deeptutor animate`)
+.[dev] — .[server] + test/lint tools
+.[all] — Everything above
```
diff --git a/README.md b/README.md
index b52b95ab6..7c2f97e87 100644
--- a/README.md
+++ b/README.md
@@ -160,8 +160,14 @@ cd DeepTutor
conda create -n deeptutor python=3.11 && conda activate deeptutor
# Install DeepTutor with backend + web server dependencies
+# (includes RAG, document parsing, and all built-in LLM provider SDKs)
pip install -e ".[server]"
+# Optional add-ons — install only the ones you need:
+# pip install -e ".[tutorbot]" # TutorBot agent engine + channel SDKs
+# pip install -e ".[math-animator]" # Manim (also requires LaTeX & ffmpeg)
+# pip install -e ".[all]" # Everything above + dev tools
+
# Install frontend dependencies (requires Node.js 18+)
cd web && npm install && cd ..
```
@@ -419,6 +425,8 @@ These directories survive `docker compose down` and are reused on the next `dock
If you just want the CLI without the web frontend:
```bash
+# Includes RAG, document parsing, and all built-in LLM provider SDKs.
+# Same set as Option B minus FastAPI/uvicorn.
pip install -e ".[cli]"
```
diff --git a/SKILL.md b/SKILL.md
index a2d35689b..5879fabc8 100644
--- a/SKILL.md
+++ b/SKILL.md
@@ -15,7 +15,7 @@ Use this skill when the user wants to:
## Prerequisites
- Python 3.11+
-- DeepTutor installed: `pip install -e .` (core) or `pip install -e ".[server]"` (with web)
+- DeepTutor installed: `pip install -e ".[cli]"` (CLI + RAG + providers) or `pip install -e ".[server]"` (adds web/API)
- Run `python scripts/start_tour.py` for first-time interactive setup (configures LLM, embedding, search providers and writes `.env`)
## Commands
diff --git a/assets/README/README_CN.md b/assets/README/README_CN.md
index 9f1a767c6..aec2abaae 100644
--- a/assets/README/README_CN.md
+++ b/assets/README/README_CN.md
@@ -156,8 +156,14 @@ cd DeepTutor
conda create -n deeptutor python=3.11 && conda activate deeptutor
# 安装 DeepTutor(后端 + Web 服务依赖)
+# 已包含 RAG、文档解析以及内置的全部 LLM 提供商 SDK
pip install -e ".[server]"
+# 可选附加组件 —— 按需安装:
+# pip install -e ".[tutorbot]" # TutorBot 智能体引擎 + 各渠道 SDK
+# pip install -e ".[math-animator]" # Manim 数学动画(另需系统 LaTeX 与 ffmpeg)
+# pip install -e ".[all]" # 上述全部 + 开发工具
+
# 安装前端依赖(需要 Node.js 18+)
cd web && npm install && cd ..
```
@@ -414,6 +420,8 @@ docker compose up -d # 或 docker compose -f docker-compose.ghcr.yml up -d
若只要 CLI、不要 Web 前端:
```bash
+# 已包含 RAG、文档解析、内置全部 LLM 提供商 SDK
+# 与方案 B 的区别仅在于不安装 FastAPI/uvicorn
pip install -e ".[cli]"
```
diff --git a/deeptutor/app/facade.py b/deeptutor/app/facade.py
index e8e54f43b..07bd8d1e5 100644
--- a/deeptutor/app/facade.py
+++ b/deeptutor/app/facade.py
@@ -105,7 +105,7 @@ class DeepTutorApp:
install_hint=(
""
if available
- else "Install with `pip install deeptutor-cli[math-animator]` "
+ else "Install with `pip install -e '.[math-animator]'` "
"or `pip install -r requirements/math-animator.txt`."
),
)
diff --git a/deeptutor/book/blocks/animation.py b/deeptutor/book/blocks/animation.py
index 07dd4ceba..702721f7d 100644
--- a/deeptutor/book/blocks/animation.py
+++ b/deeptutor/book/blocks/animation.py
@@ -31,7 +31,8 @@ class AnimationGenerator(BlockGenerator):
if importlib.util.find_spec("manim") is None:
raise GenerationFailure(
"AnimationGenerator requires the optional math-animator extras. "
- "Install with `pip install -r requirements/math-animator.txt`."
+ "Install with `pip install -e '.[math-animator]'` "
+ "or `pip install -r requirements/math-animator.txt`."
)
params = ctx.block.params
diff --git a/deeptutor_cli/README.md b/deeptutor_cli/README.md
index df1d4f29a..1110b5da6 100644
--- a/deeptutor_cli/README.md
+++ b/deeptutor_cli/README.md
@@ -8,14 +8,16 @@ Agent-first 的命令行界面。两条核心路径:
## 安装
```bash
-# 仅 CLI
-pip install -r requirements/cli.txt && pip install -e .
+# 仅 CLI(含 RAG / 文档解析 / 各家 LLM provider SDK)
+pip install -e ".[cli]"
# CLI + Web/API 服务
-pip install -r requirements/server.txt && pip install -e .
+pip install -e ".[server]"
-# 数学动画(可选)
-pip install -r requirements/math-animator.txt
+# 可选附加组件
+pip install -e ".[tutorbot]" # TutorBot 智能体引擎 + 各渠道 SDK
+pip install -e ".[math-animator]" # 数学动画(另需系统 LaTeX/ffmpeg)
+pip install -e ".[all]" # 全部依赖(含开发工具)
```
---
diff --git a/deeptutor_cli/main.py b/deeptutor_cli/main.py
index 1a5e7b2e4..0cb36ae62 100644
--- a/deeptutor_cli/main.py
+++ b/deeptutor_cli/main.py
@@ -124,7 +124,7 @@ def serve(
except ImportError:
console.print(
"[bold red]Error:[/] API server dependencies not installed.\n"
- "Run: pip install -r requirements/server.txt"
+ "Run: pip install -e '.[server]'"
)
raise typer.Exit(code=1)
diff --git a/deeptutor_cli/provider_cmd.py b/deeptutor_cli/provider_cmd.py
index 16ce79c7d..a54dbfc93 100644
--- a/deeptutor_cli/provider_cmd.py
+++ b/deeptutor_cli/provider_cmd.py
@@ -33,7 +33,7 @@ def _login_openai_codex() -> None:
from oauth_cli_kit import get_token, login_oauth_interactive
except ImportError:
typer.echo(
- "oauth_cli_kit is not installed. Install CLI deps: pip install -r requirements/cli.txt"
+ "oauth_cli_kit is not installed. Install CLI deps: pip install -e '.[cli]'"
)
raise typer.Exit(code=1)
@@ -58,7 +58,7 @@ async def _login_github_copilot() -> None:
try:
from openai import AsyncOpenAI
except ImportError:
- typer.echo("openai is not installed. Install CLI deps: pip install -r requirements/cli.txt")
+ typer.echo("openai is not installed. Install CLI deps: pip install -e '.[cli]'")
raise typer.Exit(code=1)
try:
client = AsyncOpenAI(
diff --git a/pyproject.toml b/pyproject.toml
index d9899d536..dce7636d8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -36,27 +36,77 @@ dependencies = [
deeptutor = "deeptutor_cli.main:main"
[project.optional-dependencies]
-anthropic = ["anthropic>=0.30.0"]
-dashscope = ["dashscope>=1.14.0"]
-search = ["perplexityai>=0.1.0"]
-oauth = ["oauth-cli-kit>=0.1.1; python_version >= '3.11'"]
-server = [
- "fastapi>=0.100.0",
- "uvicorn[standard]>=0.24.0",
- "websockets>=12.0",
- "python-multipart>=0.0.6",
-]
-math-animator = ["manim>=0.19.0"]
-all = [
+# Full CLI: RAG (LlamaIndex), document parsing, and LLM provider SDKs.
+# Mirrors requirements/cli.txt — keep in sync.
+cli = [
+ # LLM provider SDKs
"anthropic>=0.30.0",
"dashscope>=1.14.0",
"perplexityai>=0.1.0",
"oauth-cli-kit>=0.1.1; python_version >= '3.11'",
+ # RAG (LlamaIndex)
+ "llama-index>=0.14.12",
+ "PyMuPDF>=1.26.0",
+ "numpy>=1.24.0,<2.0.0",
+ "arxiv>=2.0.0",
+ # Document text extraction (chat attachments)
+ "python-docx>=1.1.0",
+ "openpyxl>=3.1.0",
+ "python-pptx>=1.0.0",
+ "pypdf>=4.0.0",
+]
+
+# Web/API server (CLI + FastAPI). Mirrors requirements/server.txt.
+server = [
+ "deeptutor[cli]",
"fastapi>=0.100.0",
"uvicorn[standard]>=0.24.0",
"websockets>=12.0",
"python-multipart>=0.0.6",
- "manim>=0.19.0",
+]
+
+# TutorBot agent engine + channel SDKs. Mirrors requirements/tutorbot.txt.
+tutorbot = [
+ "deeptutor[server]",
+ "loguru>=0.7.3,<1.0.0",
+ "croniter>=6.0.0,<7.0.0",
+ "json-repair>=0.57.0,<1.0.0",
+ "tiktoken>=0.12.0,<1.0.0",
+ "chardet>=3.0.2,<6.0.0",
+ "mcp>=1.26.0,<2.0.0",
+ "readability-lxml>=0.8.4,<1.0.0",
+ "python-telegram-bot[socks]>=22.6,<23.0",
+ "lark-oapi>=1.5.0,<2.0.0",
+ "dingtalk-stream>=0.24.0,<1.0.0",
+ "slack-sdk>=3.39.0,<4.0.0",
+ "slackify-markdown>=0.2.0,<1.0.0",
+ "qq-botpy>=1.2.0,<2.0.0",
+ "python-socketio>=5.16.0,<6.0.0",
+ "msgpack>=1.1.0,<2.0.0",
+ "python-socks[asyncio]>=2.8.0,<3.0.0",
+ "socksio>=1.0.0,<2.0.0",
+ "websocket-client>=1.9.0,<2.0.0",
+]
+
+# Math Animator addon (Manim). Mirrors requirements/math-animator.txt.
+# System prerequisites (installed outside pip): LaTeX, pkg-config, cairo, cmake, ffmpeg.
+math-animator = ["manim>=0.19.0"]
+
+# Dev/test tooling. Mirrors requirements/dev.txt.
+dev = [
+ "deeptutor[server]",
+ "pytest>=7.0.0",
+ "pytest-asyncio>=0.23.0",
+ "pre-commit>=3.0.0",
+ "safety<3.0.0",
+ "bandit>=1.8.0",
+]
+
+# Everything: server + tutorbot + math-animator + dev tools.
+all = [
+ "deeptutor[tutorbot]",
+ "deeptutor[math-animator]",
+ "deeptutor[dev]",
]
[tool.setuptools]
diff --git a/requirements.txt b/requirements.txt
index 2cc9bec90..668639a64 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -3,12 +3,18 @@
# ============================================
# Python >= 3.11 required
#
-# For targeted installs:
-# pip install -r requirements/cli.txt # CLI (full, with RAG + tools)
-# pip install -r requirements/server.txt # CLI + API server
-# pip install -r requirements/math-animator.txt # + Manim animation engine
-# pip install -r requirements/dev.txt # + dev/test tools
+# Single source of truth: pyproject.toml `[project.optional-dependencies]`.
+# Files under requirements/ mirror those extras for Docker/CI installs that
+# don't yet have access to pyproject.toml + source code.
#
-# This file installs the server runtime (CLI + API + TutorBot).
+# Preferred install (from a source clone):
+# pip install -e ".[cli]" # CLI (RAG + providers + document parsing)
+# pip install -e ".[server]" # CLI + FastAPI/uvicorn (Web/API)
+# pip install -e ".[tutorbot]" # Server + TutorBot agent engine
+# pip install -e ".[math-animator]" # Manim animation engine (addon)
+# pip install -e ".[dev]" # Server + dev/test tools
+# pip install -e ".[all]" # Everything
+#
+# This file installs the full server runtime (CLI + API + TutorBot).
-r requirements/tutorbot.txt
diff --git a/requirements/cli.txt b/requirements/cli.txt
index fc9173ed1..efaba5bf4 100644
--- a/requirements/cli.txt
+++ b/requirements/cli.txt
@@ -1,8 +1,11 @@
# ============================================
# DeepTutor CLI — Full Dependencies
# ============================================
-# Install: pip install -r requirements/cli.txt && pip install -e .
-# Everything needed to run the CLI with all tools (RAG, code execution, etc.)
+# Mirrors pyproject.toml `[project.optional-dependencies].cli` plus core deps.
+# Keep in sync with pyproject.toml when adding/updating dependencies.
+#
+# Preferred install (from a source clone): pip install -e ".[cli]"
+# Use this file for Docker/CI when pyproject.toml/source code aren't yet available.
# --- Config & templating ---
python-dotenv>=1.0.0
diff --git a/requirements/dev.txt b/requirements/dev.txt
index 856f0053b..099f4eee2 100644
--- a/requirements/dev.txt
+++ b/requirements/dev.txt
@@ -1,8 +1,11 @@
# ============================================
# DeepTutor Development Dependencies
# ============================================
-# Install: pip install -r requirements/dev.txt
-# Includes full runtime + development tooling.
+# Mirrors pyproject.toml `[project.optional-dependencies].dev`.
+# Keep in sync with pyproject.toml when adding/updating dependencies.
+#
+# Preferred install (from a source clone): pip install -e ".[dev]"
+# Use this file for Docker/CI when pyproject.toml/source code aren't yet available.
-r server.txt
diff --git a/requirements/math-animator.txt b/requirements/math-animator.txt
index 4d92bde22..e5dc674c6 100644
--- a/requirements/math-animator.txt
+++ b/requirements/math-animator.txt
@@ -1,8 +1,12 @@
# ============================================
# DeepTutor Math Animator — Addon
# ============================================
-# Install: pip install -r requirements/math-animator.txt
-# Addon for `deeptutor animate`. Install alongside cli.txt or server.txt.
+# Mirrors pyproject.toml `[project.optional-dependencies].math-animator`.
+# Keep in sync with pyproject.toml when adding/updating dependencies.
+#
+# Preferred install (from a source clone): pip install -e ".[math-animator]"
+# Use this file for Docker/CI when pyproject.toml/source code aren't yet available.
+# Install alongside `.[cli]` or `.[server]`.
#
# System prerequisites (installed outside pip):
# - LaTeX runtime (`latex`) for Tex/MathTex rendering
diff --git a/requirements/server.txt b/requirements/server.txt
index 6c7350fb1..c5b54a957 100644
--- a/requirements/server.txt
+++ b/requirements/server.txt
@@ -1,8 +1,11 @@
# ============================================
# DeepTutor Server — Full Dependencies (CLI + Web)
# ============================================
-# Install: pip install -r requirements/server.txt && pip install -e .
-# Everything needed to run the API server and web frontend.
+# Mirrors pyproject.toml `[project.optional-dependencies].server`.
+# Keep in sync with pyproject.toml when adding/updating dependencies.
+#
+# Preferred install (from a source clone): pip install -e ".[server]"
+# Use this file for Docker/CI when pyproject.toml/source code aren't yet available.
-r cli.txt
diff --git a/requirements/tutorbot.txt b/requirements/tutorbot.txt
index ab17800df..222c92ecb 100644
--- a/requirements/tutorbot.txt
+++ b/requirements/tutorbot.txt
@@ -1,9 +1,11 @@
# ============================================
# DeepTutor TutorBot — Agent Engine Dependencies
# ============================================
-# Install: pip install -r requirements/tutorbot.txt
-# These are the extra dependencies needed for TutorBot channels and agent features.
-# DeepTutor's core dependencies (litellm, pydantic, httpx, etc.) are NOT repeated here.
+# Mirrors pyproject.toml `[project.optional-dependencies].tutorbot`.
+# Keep in sync with pyproject.toml when adding/updating dependencies.
+#
+# Preferred install (from a source clone): pip install -e ".[tutorbot]"
+# Use this file for Docker/CI when pyproject.toml/source code aren't yet available.
-r server.txt