Skip to content

Commit

Permalink
Update python3.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanY610 authored Feb 19, 2023
1 parent 261625f commit a64a36d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Python/python3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ else
apt install wget build-essential libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev -y
fi
#安装主体
cd /root/
echo -e "\e[1;33m请输入你要下载的python版本\e[0m:
例如:
\e[1;31m3.11.2 3.10.3 3.9.13 3.8.13 3.7.10\e[0m"
read -e -p "请输入:" version
wget https://www.python.org/ftp/python/$version/Python-$version.tgz
[ ! $? -eq 0 ] && echo -e "\e[1;31m请输入正确的python版本!!!\e[0m" && exit 1
tar -zxf Python-$version.tgz && rm -rf Python-$version.tgz
tar -zxf Python-$version.tgz
cd Python-$version
./configure --prefix=/usr/local/python3 --enable-optimizations
make
Expand All @@ -42,7 +43,7 @@ if [ $? -eq 0 ];then
ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3
echo "python 版本为:"
python3 -V && pip3 -V
rm -rf Python-$version.tgz && rm -rf Python-$version
cd /root/ && rm -rf Python-$version.tgz && rm -rf Python-$version
else
clear
echo -e "\e[1;31m安装失败!\e[0m" && exit 1
Expand Down

0 comments on commit a64a36d

Please sign in to comment.