Skip to content

Commit ed7ae47

Browse files
committed
test=develop, fix mac python check error
1 parent a6af361 commit ed7ae47

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

paddle/scripts/fast_install.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ function checkMacPython2(){
4040
else
4141
python_version=""
4242
fi
43+
check_python=`echo $python_version | grep "Python 2"`
44+
echo $check_python
4345
if [ "$python_version" == "" ] || [ "$python_root" == "/usr/bin/python" -a "$python_version" == "Python 2.7.10" ] ;then
4446
python_version=""
45-
else
47+
elif [ -n "$check_python" ];then
4648
while true
4749
do
4850
read -p "找到:$python_version, 是否使用:(y/n),输入n来输入自定义使用的python路径,或者按ctrl + c退出: " use_python
@@ -60,6 +62,9 @@ function checkMacPython2(){
6062
if [ "$use_python" == "y" ];then
6163
break
6264
fi
65+
else
66+
echo "您输入Python的不是Python2"
67+
python_version=""
6368
fi
6469
done
6570
}
@@ -77,9 +82,10 @@ function checkMacPython3(){
7782
else
7883
python_version=""
7984
fi
85+
check_python=`echo $python_version | grep "Python 3"`
8086
if [ "$python_version" == "" ] || [ "$python_root" == "/usr/bin/python" -a "$python_version" == "Python 2.7.10" ] ;then
8187
python_version=""
82-
else
88+
elif [ -n "$check_python" ] ;then
8389
while true
8490
do
8591
read -p "找到:$python_version, 是否使用:(y/n),输入n来输入自定义使用的python路径,或者按ctrl + c退出: " use_python
@@ -97,6 +103,9 @@ function checkMacPython3(){
97103
if [ "$use_python" == "y" ];then
98104
break
99105
fi
106+
else
107+
echo "您输入Python的不是Python2"
108+
python_version=""
100109
fi
101110
done
102111
}

0 commit comments

Comments
 (0)