2023-03-03 17:36:15 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
command -v python3 > /dev/null || {
|
|
|
|
echo "python3 executable not found, exiting"
|
2023-03-15 17:51:49 +00:00
|
|
|
exit 1
|
2023-03-03 17:36:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
python3 -c "import sys; assert sys.version_info[0] >= 3 and sys.version_info[1] >= 7" || {
|
|
|
|
echo python3 --version
|
|
|
|
echo "python version too old, requires >=3.7"
|
2023-03-15 17:51:49 +00:00
|
|
|
exit 1
|
2023-03-03 17:36:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
USERSITE=$(python3 -c "import site; print(site._get_path(site._getuserbase()))")
|
|
|
|
mkdir -p $USERSITE
|
|
|
|
|
|
|
|
if [[ ! -e "$USERSITE/pipx" ]]
|
|
|
|
then
|
|
|
|
python3 -m pip install --user pipx
|
|
|
|
fi
|