This commit is contained in:
parent
da82d8ee17
commit
59678411af
|
|
@ -38,13 +38,22 @@ echo "✓ Python3 已安装: $(python3 --version)"
|
|||
# 4. 检查 Python 依赖
|
||||
echo ""
|
||||
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
|
||||
echo "安装 PyYAML..."
|
||||
pip3 install --user PyYAML
|
||||
python3 -m pip install --user PyYAML
|
||||
fi
|
||||
if ! python3 -c "import flask" 2>/dev/null; then
|
||||
echo "安装 Flask..."
|
||||
pip3 install --user flask
|
||||
python3 -m pip install --user flask
|
||||
fi
|
||||
echo "✓ Python 依赖检查完成"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue