summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--[-rwxr-xr-x]scripts/install_api.py5
-rw-r--r--[-rwxr-xr-x]scripts/linux-setup.sh10
2 files changed, 11 insertions, 4 deletions
diff --git a/scripts/install_api.py b/scripts/install_api.py
index 646bd4fe..0ffd04ab 100755..100644
--- a/scripts/install_api.py
+++ b/scripts/install_api.py
@@ -8,10 +8,11 @@ import os
from site import check_enableusersite
# Handle both normal environments and virtualenvs
-from distutils.sysconfig import get_python_lib as getsitepackages
try:
- from site import getusersitepackages
+ from site import getusersitepackages, getsitepackages
except ImportError:
+ from sysconfig import get_path
+ getsitepackages = lambda: get_path('purelib')
getusersitepackages = getsitepackages
# Hacky command line parsing to accept a silent-install -s flag like linux-setup.sh:
diff --git a/scripts/linux-setup.sh b/scripts/linux-setup.sh
index 4c9be22e..43c6ec88 100755..100644
--- a/scripts/linux-setup.sh
+++ b/scripts/linux-setup.sh
@@ -71,8 +71,14 @@ pythonpath()
else
SILENT=""
fi
- python -V >/dev/null 2>&1 && ${SUDO}python ${BNPATH}/scripts/install_api.py ${ROOT} ${SILENT}
- python3 -V >/dev/null 2>&1 && ${SUDO}python3 ${BNPATH}/scripts/install_api.py ${ROOT} ${SILENT}
+ if [[ -x "`which python`" ]]
+ then
+ python -V >/dev/null 2>&1 && ${SUDO}python ${BNPATH}/scripts/install_api.py ${ROOT} ${SILENT}
+ fi
+ if [[ -x "`which python3`" ]]
+ then
+ python3 -V >/dev/null 2>&1 && ${SUDO}python3 ${BNPATH}/scripts/install_api.py ${ROOT} ${SILENT}
+ fi
}
createdesktopfile()