This commit is contained in:
孙小云 2026-02-03 15:59:09 +08:00
parent 59678411af
commit 80304fcfa8
1 changed files with 4 additions and 1 deletions

View File

@ -42,17 +42,20 @@ echo "[步骤 4/7] 检查 Python 依赖..."
# 检查并安装 pip
if ! python3 -m pip --version &> /dev/null; then
echo "pip 未安装,正在安装 pip..."
curl -sS https://bootstrap.pypa.io/get-pip.py | python3 - --user --break-system-packages 2>/dev/null || \
curl -sS https://bootstrap.pypa.io/get-pip.py | python3 - --user
echo "✓ pip 安装完成"
fi
# 使用 python3 -m pip 代替 pip3
# 使用 python3 -m pip 代替 pip3,添加 --break-system-packages 标志
if ! python3 -c "import yaml" 2>/dev/null; then
echo "安装 PyYAML..."
python3 -m pip install --user --break-system-packages PyYAML 2>/dev/null || \
python3 -m pip install --user PyYAML
fi
if ! python3 -c "import flask" 2>/dev/null; then
echo "安装 Flask..."
python3 -m pip install --user --break-system-packages flask 2>/dev/null || \
python3 -m pip install --user flask
fi
echo "✓ Python 依赖检查完成"