app/docs/zh/deploy/install.md
Nanaloveyuki 908812a3d9
Some checks failed
Docker Image Build / build (push) Failing after 2m10s
Deploy VitePress site to Liteyuki PaaS / build (push) Failing after 2m30s
Pre-commit checks / pre-commit (3.10) (push) Failing after 3m7s
Pre-commit checks / pre-commit (3.11) (push) Failing after 2m37s
Pre-commit checks / pre-commit (3.12) (push) Failing after 2m42s
Pre-commit checks / pre-commit (3.13) (push) Failing after 3m18s
📝 重置了deploy下的文档
新添加了adapter.md用来转移配置器相关内容; 修改了部分文件的版权归属日期;
2025-04-03 21:54:03 +08:00

96 lines
2.8 KiB
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: 安装
order: 1
---
# 安装
## **常规部署**
### 安装基本环境
**Git 版本管理工具**
[Git](https://git-scm.com/download/)
**Python3.10+**
[Python3.10+](https://www.python.org/downloads/release/python-31010/)
### 克隆项目到本地轻雪使用Git进行版本管理该步骤为必要项
`git clone https://github.com/LiteyukiStudio/LiteyukiBot --depth=1`
> 若你不能访问Github可以使用Liteyuki镜像`https://git.liteyuki.icu/bot/app`
### 切换到Bot目录下
`cd LiteyukiBot`
> 如果存在文件夹缺失报错, 尝试使用绝对路径进行路径跳转
### 创建虚拟环境
`python -m venv venv`
> 如果出现相关虚拟环境错误, 建议查询 [Python Venv](https://docs.python.org/3/library/venv.html)
### 激活虚拟环境
Windows:
`.\venv\Scripts\activate`
> 出现`'activate' 不是内部或外部命令,也不是可运行的程序或批处理文件。`错误, 请使用完整路径激活虚拟环境
Linux:
`source venv/bin/activate`
> 如果出现`source: command not found`, 请使用完整路径激活虚拟环境
### 安装依赖
`pip install -r requirements.txt`
> 若出现`ERROR: Could not open requirements file: [Errno 2] No such file or directory`错误, 请检查是否在Bot目录下执行命令
> 若出现`ERROR: Could not build wheels for xx, which is required to install pyproject.toml-based projects`错误,请尝试使用手动命令安装相关依赖(虚拟环境下执行`pip install xx`,例如`pip install Pillow`)
### 启动Bot
`python main.py`
> 若出现`ModuleNotFoundError: No module named 'xx'`错误, 请尝试重新执行安装依赖步骤
## **使用Docker构建**
```bash
docker pull ghcr.io/liteyukistudio/liteyukibot:latest # 每夜版镜像
```
> [!tip]
> Windows请使用项目绝对目录`/path/to/LiteyukiBot`代替`$(pwd)` <br>
> 若你修改了端口号请将`20216:20216`中的`20216`替换为你的端口号
## **装置要求**
- Windows系统版本推荐最低版本: `Windows 10 21H2` / `Windows Server 2019+`
>版本低于`Windows 10 21H2` 可能无法正常使用Bot, 建议升级系统版本或使用Docker部署
- Linux系统要支持Python3.10+,推荐`Ubuntu 20.04+`(~~别用你那b CentOS~~)
- CPU: 至少`1vCPU`
- 内存: Bot无其他插件会占用`300~500MB`,包括`chromium``node`等进程,其他插件占用视具体插件而定,建议`1GB`以上
- 硬盘: 至少`1GB`空间
> [!warning]
> 如果装置上有多个环境,请使用`path/to/python -m pip install -r requirements.txt`来安装依赖,`path/to/python`
> 为你的Python可执行文件路径
> [!warning]
> 轻雪的更新功能依赖Git如果你没有安装Git直接下载源代码运行你将无法使用更新功能(除非你闲的手动下载源代码更新轻雪~~)
#### 其他问题请移步至[答疑](./fandq)