aboutsummaryrefslogtreecommitdiff
path: root/src/python/install.sh
diff options
context:
space:
mode:
authorSamruddhi Khandale <skhandale@microsoft.com>2022-11-16 00:26:26 +0300
committerGitHub <noreply@github.com>2022-11-16 00:26:26 +0300
commitf9acb6aae1e520b0b61aaac9ab4ecb00dd497451 (patch)
treeee6c4e60efa56f52b6258f40d0b663da06b690a9 /src/python/install.sh
parenta5655189a24b04fc43f4ae9dcae0be5acf1b9ecb (diff)
Python bug fix - Add jupyterlab even if python is not installed by Feature but exists (#244)
* python fix bug * fix test * address comments * address comment
Diffstat (limited to 'src/python/install.sh')
-rwxr-xr-xsrc/python/install.sh13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/python/install.sh b/src/python/install.sh
index 93d9cce..79ab7de 100755
--- a/src/python/install.sh
+++ b/src/python/install.sh
@@ -322,7 +322,7 @@ sudo_if() {
install_user_package() {
PACKAGE="$1"
- sudo_if "$INSTALL_PATH/bin/python3" -m pip install --user --upgrade --no-cache-dir "$PACKAGE"
+ sudo_if "${PYTHON_SRC}" -m pip install --user --upgrade --no-cache-dir "$PACKAGE"
}
add_user_jupyter_config() {
@@ -408,11 +408,15 @@ if [ "${PYTHON_VERSION}" != "none" ]; then
updaterc "if [[ \"\${PATH}\" != *\"${CURRENT_PATH}/bin\"* ]]; then export PATH=${CURRENT_PATH}/bin:\${PATH}; fi"
PATH="${INSTALL_PATH}/bin:${PATH}"
fi
-
+
# Updates the symlinks for os-provided, or the installed python version in other cases
chown -R "${USERNAME}:python" "${PYTHON_INSTALL_PATH}"
chmod -R g+r+w "${PYTHON_INSTALL_PATH}"
find "${PYTHON_INSTALL_PATH}" -type d -print0 | xargs -0 -n 1 chmod g+s
+
+ PYTHON_SRC="${INSTALL_PATH}/bin/python3"
+else
+ PYTHON_SRC=$(which python)
fi
# Install Python tools if needed
@@ -464,6 +468,11 @@ fi
# Install JupyterLab if needed
if [ "${INSTALL_JUPYTERLAB}" = "true" ]; then
+ if [ -z "${PYTHON_SRC}" ]; then
+ echo "(!) Could not install Jupyterlab. Python not found."
+ exit 1
+ fi
+
install_user_package jupyterlab
install_user_package jupyterlab-git