Files
Nexus/docs/changelog/2026-06-08-agent-install-bt-pyenv-python.md
2026-07-08 22:31:31 +08:00

30 lines
988 B
Markdown
Raw Permalink 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.
# 2026-06-08 — Agent 安装支持宝塔 panel pyenv Python
## 摘要
## 2026-06-08 更新(宝塔不可执行时自动装系统 Python)
- 宝塔 `/www/server/panel/pyenv/bin` 仅当 **当前 SSH 用户可执行**`-x`)时才使用
- 不可执行时不走 sudo 宝塔 Python,改为 `apt/dnf/yum` 自动安装系统 `python3.12`Ubuntu 失败时尝试 deadsnakes PPA
- 安装成功后使用系统 Python 创建 venv
## 涉及文件
- `web/agent/install.sh` — 增加 `_bt_panel_python_candidates()`,在系统路径之后、`python3` 之前尝试 BT pyenv
- `server/api/servers.py` — 补充安装错误中文映射
## 迁移 / 重启
- 无需 DB 迁移
- 需将更新后的 `web/agent/install.sh` 同步到生产(静态资源或整包部署),子机重新执行安装即可
## 验证
```bash
# 本地语法
bash -n web/agent/install.sh
# 生产:对目标子机重试「安装 Agent」,日志应显示 Using: /www/server/panel/pyenv/bin/python3.x
```