docs: 增加Python虚拟环境依赖说明
This commit is contained in:
+19
-2
@@ -2,10 +2,27 @@
|
||||
|
||||
所有环境配置集中在 [`config.yaml`](./config.yaml)(带注释)。脚本会据此自动生成根目录 `.env`,**无需手改 .env**。
|
||||
|
||||
脚本现在直接用本机 Python 运行。首次运行前请先安装脚本依赖:
|
||||
脚本现在直接用本机 Python 运行。建议使用项目内虚拟环境,避免污染全局 Python。
|
||||
|
||||
首次运行前:
|
||||
|
||||
```bash
|
||||
python -m pip install pyyaml psutil pymysql
|
||||
python -m venv .venv
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
python -m pip install -r scripts/requirements.txt
|
||||
```
|
||||
|
||||
如果 PowerShell 阻止激活脚本,可在当前终端临时放行后再激活:
|
||||
|
||||
```bash
|
||||
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
```
|
||||
|
||||
之后每次运行脚本前,先激活虚拟环境:
|
||||
|
||||
```bash
|
||||
.\.venv\Scripts\Activate.ps1
|
||||
```
|
||||
|
||||
| 脚本 | 作用 |
|
||||
|
||||
Reference in New Issue
Block a user