2021-08-15 15:51:24 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2022-02-12 14:38:12 +00:00
|
|
|
VERSION="3.10.2"
|
2021-08-15 15:51:24 +00:00
|
|
|
|
|
|
|
function install () {
|
|
|
|
cd ~
|
2021-11-24 14:14:39 +00:00
|
|
|
curl -O https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz
|
2021-08-15 15:51:24 +00:00
|
|
|
sudo tar -xvzf Python-${VERSION}.tgz
|
|
|
|
cd Python-${VERSION}
|
|
|
|
./configure \
|
|
|
|
--prefix=/opt/python/${VERSION} \
|
|
|
|
--enable-shared \
|
|
|
|
--enable-ipv6 \
|
|
|
|
LDFLAGS=-Wl,-rpath=/opt/python/${VERSION}/lib,--disable-new-dtags
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
cd ~
|
|
|
|
curl -O https://bootstrap.pypa.io/get-pip.py
|
|
|
|
sudo /opt/python/${VERSION}/bin/python3 get-pip.py
|
|
|
|
|
2021-11-24 14:14:39 +00:00
|
|
|
sudo rm Python-${VERSION}.tgz
|
|
|
|
sudo rm -rf Python-${VERSION}
|
2021-08-15 15:51:24 +00:00
|
|
|
sudo rm get-pip.py
|
2021-11-24 14:14:39 +00:00
|
|
|
|
2021-08-17 05:08:52 +00:00
|
|
|
printf "\n\n"
|
|
|
|
python3 --version
|
2021-08-15 15:51:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if [ "$1" == "install" ]; then
|
|
|
|
install
|
|
|
|
# elif [ "$1" == "uninstall" ]; then
|
|
|
|
# uninstall
|
|
|
|
else
|
2022-02-06 06:20:19 +00:00
|
|
|
echo "Only install"
|
2021-11-24 14:14:39 +00:00
|
|
|
fi
|