2020-09-12 13:45:03 +08:00
|
|
|
# 安装
|
|
|
|
|
|
|
|
## NoneBot
|
|
|
|
|
|
|
|
:::warning 注意
|
|
|
|
请确保你的 Python 版本 >= 3.7。
|
|
|
|
:::
|
|
|
|
|
2020-12-01 12:24:14 +08:00
|
|
|
:::warning 注意
|
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-12-01 12:24:14 +08:00
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
### 通过脚手架安装(推荐安装方式)
|
|
|
|
|
|
|
|
1. (可选)使用你喜欢的 Python 环境管理工具创建新的虚拟环境。
|
|
|
|
2. 使用 `pip` (或其他) 安装 NoneBot 脚手架。
|
|
|
|
|
|
|
|
```bash
|
|
|
|
pip install nb-cli
|
|
|
|
```
|
|
|
|
|
2020-12-01 17:08:15 +08:00
|
|
|
3. 点个 star 吧
|
|
|
|
|
|
|
|
nonebot2: [![nb-cli](https://img.shields.io/github/stars/nonebot/nonebot2?style=social)](https://github.com/nonebot/nonebot2)
|
|
|
|
|
|
|
|
nb-cli: [![nb-cli](https://img.shields.io/github/stars/nonebot/nb-cli?style=social)](https://github.com/nonebot/nb-cli)
|
|
|
|
|
2020-12-01 12:24:14 +08:00
|
|
|
### 不使用脚手架(纯净安装)
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# poetry
|
|
|
|
poetry add nonebot2
|
|
|
|
# pip
|
2020-09-12 13:45:03 +08:00
|
|
|
pip install nonebot2
|
|
|
|
```
|
|
|
|
|
2020-12-01 12:24:14 +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
|
|
|
```
|