dotfiles/scripts/python.sh

37 lines
777 B
Bash
Raw Normal View History

#!/usr/bin/env bash
2022-08-19 13:49:23 +00:00
VERSION="3.10.6"
function install () {
cd ~
2021-11-24 14:14:39 +00:00
curl -O https://www.python.org/ftp/python/${VERSION}/Python-${VERSION}.tgz
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
2022-08-19 13:49:23 +00:00
make -j $(nproc)
sudo make install -j $(nproc)
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}
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
}
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