安装指南

🚀 快速开始

使用超快的 uv 包管理器进行安装。

installation-with-uv-recommended
📦 标准 Pip

使用标准的 Python pip 工具进行安装。

installation-with-pip

Note

要求:Python 3.11 或更高版本。

安装

选择您喜欢的包管理器:

首先,确保您已安装 uv

# 标准 CPU 版本
uv pip install canns

# 使用加速器
uv pip install "canns[cuda12]"   # NVIDIA CUDA 12
uv pip install "canns[tpu]"      # Google TPU
# 标准 CPU 版本
pip install canns

# 使用加速器
pip install "canns[cuda12]"   # NVIDIA CUDA 12
pip install "canns[tpu]"      # Google TPU
git clone https://github.com/routhleck/canns.git
cd canns
pip install -e .

验证安装

import canns
print(f"✅ 成功安装 canns 版本 {canns.__version__}")

See also

准备好了吗?查看 第一步指南