nonebot2/docs/guide/installation.md

87 lines
1.7 KiB
Markdown
Raw Normal View History

2020-09-12 13:45:03 +08:00
# 安装
## NoneBot
:::warning 注意
请确保你的 Python 版本 >= 3.7。
:::
2020-10-16 17:15:40 +08:00
请在安装 nonebot2 之前卸载 nonebot 1.x
2020-09-12 13:45:03 +08:00
```bash
2020-10-16 17:15:40 +08:00
pip uninstall nonebot
2020-09-12 13:45:03 +08:00
pip install nonebot2
```
2020-11-11 16:49:11 +08:00
如果你需要使用最新的(可能尚未发布的)特性,可以直接从 GitHub 仓库安装:
2020-11-10 14:44:24 +08:00
```bash
# master
poetry add git+https://github.com/nonebot/nonebot2.git#master
# dev
poetry add git+https://github.com/nonebot/nonebot2.git#dev
```
或者克隆 Git 仓库后手动安装:
2020-09-12 13:45:03 +08:00
```bash
git clone https://github.com/nonebot/nonebot2.git
cd nonebot2
2020-09-17 13:12:48 +08:00
poetry install --no-dev # 推荐
pip install . # 不推荐
2020-09-12 13:45:03 +08:00
```
## 额外依赖
### APScheduler
A task scheduling library for Python.
2020-09-13 00:18:31 +08:00
可用于计划任务,后台执行任务等
2020-09-12 13:45:03 +08:00
```bash
pip install nonebot2[scheduler]
poetry add nonebot2[scheduler]
```
2020-11-23 14:15:30 +08:00
[![apscheduler](https://img.shields.io/github/stars/agronholm/apscheduler?style=social)](https://github.com/agronholm/apscheduler)
2020-09-12 13:45:03 +08:00
### NoneBot-Test
A test frontend for nonebot2.
通过前端展示 nonebot 已加载的插件以及运行状态,同时可以用于模拟发送事件测试机器人
```bash
pip install nonebot2[test]
poetry add nonebot2[test]
```
2020-11-23 14:15:30 +08:00
[![nonebot-test](https://img.shields.io/github/stars/nonebot/nonebot-test?style=social)](https://github.com/nonebot/nonebot-test)
2020-09-12 13:45:03 +08:00
### CLI
CLI for nonebot2.
一个多功能脚手架
```bash
pip install nonebot2[cli]
poetry add nonebot2[cli]
```
2020-11-23 14:15:30 +08:00
[![nb-cli](https://img.shields.io/github/stars/nonebot/nb-cli?style=social)](https://github.com/yanyongyu/nb-cli)
2020-09-12 13:45:03 +08:00
### 我全都要
```bash
pip install nonebot2[full]
poetry add nonebot2[full]
```
```bash
pip install nonebot2[cli,scheduler]
poetry add nonebot2[cli,scheduler]
```