This commit is contained in:
孙小云 2026-02-03 15:57:41 +08:00
parent da82d8ee17
commit 59678411af
1 changed files with 11 additions and 2 deletions

View File

@ -38,13 +38,22 @@ echo "✓ Python3 已安装: $(python3 --version)"
# 4. 检查 Python 依赖 # 4. 检查 Python 依赖
echo "" echo ""
echo "[步骤 4/7] 检查 Python 依赖..." 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
echo "✓ pip 安装完成"
fi
# 使用 python3 -m pip 代替 pip3
if ! python3 -c "import yaml" 2>/dev/null; then if ! python3 -c "import yaml" 2>/dev/null; then
echo "安装 PyYAML..." echo "安装 PyYAML..."
pip3 install --user PyYAML python3 -m pip install --user PyYAML
fi fi
if ! python3 -c "import flask" 2>/dev/null; then if ! python3 -c "import flask" 2>/dev/null; then
echo "安装 Flask..." echo "安装 Flask..."
pip3 install --user flask python3 -m pip install --user flask
fi fi
echo "✓ Python 依赖检查完成" echo "✓ Python 依赖检查完成"