shell-host/install/lang/python/python.inst

23 lines
827 B
Bash
Executable File

#!/bin/bash
declare dir="$(dirname $(realpath "${BASH_SOURCE:-$0}"))"
# todo call distro specific install
echo updating...
sudo apt-get update >/dev/null 2>&1
echo installing pip and venv for python3
sudo apt-get install python3-pip python3-venv -y >/dev/null
echo loading $dir/python.lib
source $dir/python.lib
echo available alias for pip use with sudo for libraries
alias | grep spip
mkdir -p /opt/python/apps/bin
echo always use pip with sudo for libraries, for apps use pipx
sudo -H python3 -m pip install pipx >/dev/null 2>&1
BASH_SHELL_HOST=${BASH_SHELL_HOST:-$(dirname $BASH_SHELL_BASE)/$(hostname)}
mkdir -p $BASH_SHELL_HOST/load
cp $dir/python.lib $BASH_SHELL_HOST/load/
echo installed pipx version $(pipx --version) at $(which pipx)
echo installing pypi apps to
env | grep PIP
echo available alias
alias | grep pipx