2020-11-21 18:07:26 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
DIR=$(dirname "$(readlink -f "$0")")
|
|
|
|
. "$DIR/../env.sh"
|
|
|
|
|
|
|
|
log "Setting up python3"
|
|
|
|
|
|
|
|
if in_china; then
|
|
|
|
|
|
|
|
# config pip mirror for CHINA
|
|
|
|
mkdir -p "$HOME/.pip"
|
|
|
|
echo "
|
|
|
|
[global]
|
|
|
|
index-url = https://mirrors.aliyun.com/pypi/simple
|
|
|
|
" | sed -r 's/^ *//' | sudo tee "/etc/pip.conf"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# install python3
|
|
|
|
case "$PM" in
|
|
|
|
apt)
|
|
|
|
#for older ubuntu distro
|
|
|
|
#sudo add-apt-repository ppa:deadsnakes/ppa
|
|
|
|
#sudo apt-get update
|
|
|
|
#sudo apt-get install python3.8
|
|
|
|
#sudo apt install python3.8-distutils
|
|
|
|
#sudo python3.8 -m pip install --upgrade pip setuptools wheel
|
2020-11-23 02:00:49 +00:00
|
|
|
sudo apt install -y python3 python3-pip python-is-python3
|
2020-11-21 18:07:26 +00:00
|
|
|
;;
|
|
|
|
pacman)
|
|
|
|
sudo pacman -S --noconfirm --needed python python-pip
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# enable auto_activation plugin for virtualfish
|
|
|
|
if has_fish; then
|
|
|
|
sudo pip install virtualfish
|
|
|
|
fish -c "yes | vf install && vf addplugins auto_activation"
|
|
|
|
fi
|
|
|
|
|