From 6bf8792bb699006b9ca071e003c7bf69ba89a53a Mon Sep 17 00:00:00 2001 From: hiCasper Date: Sat, 10 Dec 2022 02:47:12 +0800 Subject: [PATCH] Fix pip location --- scripts/lib.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/scripts/lib.sh b/scripts/lib.sh index bf5be5409..faadf7eba 100755 --- a/scripts/lib.sh +++ b/scripts/lib.sh @@ -47,13 +47,14 @@ else echo "OK" fi +cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") +PIPSRC="https://pypi.python.org/simple" +if [ ! -z "$cn" ];then + PIPSRC="https://pypi.tuna.tsinghua.edu.cn/simple" +fi + #面板需要的库 -if [ ! -f /usr/local/bin/pip3 ];then - cn=$(curl -fsSL -m 10 http://ipinfo.io/json | grep "\"country\": \"CN\"") - PIPSRC="https://pypi.python.org/simple" - if [ ! -z "$cn" ];then - PIPSRC="https://pypi.tuna.tsinghua.edu.cn/simple" - fi +if [ ! -f /usr/local/bin/pip3 ] && [ ! -f /usr/bin/pip3 ];then python3 -m pip install --upgrade pip setuptools wheel -i $PIPSRC fi