fix: 离线环境自动安装 pip3(通过 get-pip.py 引导)

This commit is contained in:
tian 2026-07-24 08:42:00 +08:00
parent b2b037bb5b
commit bf0f838fbc
2 changed files with 27930 additions and 0 deletions

27924
deps/get-pip.py vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -57,6 +57,12 @@ fi
# 安装 Python 依赖全局root 可访问)
if [ -d "$INSTALL_DIR/deps" ] && ls "$INSTALL_DIR/deps"/*.whl >/dev/null 2>&1; then
# 先确保 pip3 可用(离线环境下可能未安装)
if ! command -v pip3 &>/dev/null; then
if [ -f "$INSTALL_DIR/deps/get-pip.py" ]; then
python3 "$INSTALL_DIR/deps/get-pip.py" --no-setuptools --no-wheel 2>&1
fi
fi
if pip3 install --force-reinstall "$INSTALL_DIR"/deps/*.whl 2>&1; then
echo " ✓ Python 依赖已安装"
else