Skip to content

Commit

Permalink
Fix python path in vscode (#657)
Browse files Browse the repository at this point in the history
* Fix python path
* Create file in the workspace
  • Loading branch information
wg102 authored Aug 21, 2024
1 parent c4d8fb0 commit 38257f8
Show file tree
Hide file tree
Showing 8 changed files with 112 additions and 0 deletions.
14 changes: 14 additions & 0 deletions output/docker-stacks-datascience-notebook/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ export JWT="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
echo "NB_PREFIX=${NB_PREFIX}" >> /opt/conda/lib/R/etc/Renviron
echo "NB_NAMESPACE=$NB_NAMESPACE" >> /opt/conda/lib/R/etc/Renviron

# change python location for vscode
pythonInterpreterPath='{"python.defaultInterpreterPath": "/opt/conda/bin/python"}'

if [ ! -d /home/jovyan/workspace/.vscode ]; then
mkdir -p /home/jovyan/workspace/.vscode;
fi

if [ ! -f /home/jovyan/workspace/.vscode/settings.json ]; then
#Not found
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
else
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
fi

# Revert forced virtualenv, was causing issues with users
#export PIP_REQUIRE_VIRTUALENV=true
#echo "Checking if Python venv exists"
Expand Down
14 changes: 14 additions & 0 deletions output/jupyterlab-cpu/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ export JWT="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
echo "NB_PREFIX=${NB_PREFIX}" >> /opt/conda/lib/R/etc/Renviron
echo "NB_NAMESPACE=$NB_NAMESPACE" >> /opt/conda/lib/R/etc/Renviron

# change python location for vscode
pythonInterpreterPath='{"python.defaultInterpreterPath": "/opt/conda/bin/python"}'

if [ ! -d /home/jovyan/workspace/.vscode ]; then
mkdir -p /home/jovyan/workspace/.vscode;
fi

if [ ! -f /home/jovyan/workspace/.vscode/settings.json ]; then
#Not found
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
else
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
fi

# Revert forced virtualenv, was causing issues with users
#export PIP_REQUIRE_VIRTUALENV=true
#echo "Checking if Python venv exists"
Expand Down
14 changes: 14 additions & 0 deletions output/jupyterlab-pytorch/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ export JWT="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
echo "NB_PREFIX=${NB_PREFIX}" >> /opt/conda/lib/R/etc/Renviron
echo "NB_NAMESPACE=$NB_NAMESPACE" >> /opt/conda/lib/R/etc/Renviron

# change python location for vscode
pythonInterpreterPath='{"python.defaultInterpreterPath": "/opt/conda/bin/python"}'

if [ ! -d /home/jovyan/workspace/.vscode ]; then
mkdir -p /home/jovyan/workspace/.vscode;
fi

if [ ! -f /home/jovyan/workspace/.vscode/settings.json ]; then
#Not found
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
else
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
fi

# Revert forced virtualenv, was causing issues with users
#export PIP_REQUIRE_VIRTUALENV=true
#echo "Checking if Python venv exists"
Expand Down
14 changes: 14 additions & 0 deletions output/jupyterlab-tensorflow/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ export JWT="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
echo "NB_PREFIX=${NB_PREFIX}" >> /opt/conda/lib/R/etc/Renviron
echo "NB_NAMESPACE=$NB_NAMESPACE" >> /opt/conda/lib/R/etc/Renviron

# change python location for vscode
pythonInterpreterPath='{"python.defaultInterpreterPath": "/opt/conda/bin/python"}'

if [ ! -d /home/jovyan/workspace/.vscode ]; then
mkdir -p /home/jovyan/workspace/.vscode;
fi

if [ ! -f /home/jovyan/workspace/.vscode/settings.json ]; then
#Not found
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
else
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
fi

# Revert forced virtualenv, was causing issues with users
#export PIP_REQUIRE_VIRTUALENV=true
#echo "Checking if Python venv exists"
Expand Down
14 changes: 14 additions & 0 deletions output/remote-desktop/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ export JWT="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
echo "NB_PREFIX=${NB_PREFIX}" >> /opt/conda/lib/R/etc/Renviron
echo "NB_NAMESPACE=$NB_NAMESPACE" >> /opt/conda/lib/R/etc/Renviron

# change python location for vscode
pythonInterpreterPath='{"python.defaultInterpreterPath": "/opt/conda/bin/python"}'

if [ ! -d /home/jovyan/workspace/.vscode ]; then
mkdir -p /home/jovyan/workspace/.vscode;
fi

if [ ! -f /home/jovyan/workspace/.vscode/settings.json ]; then
#Not found
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
else
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
fi

# Revert forced virtualenv, was causing issues with users
#export PIP_REQUIRE_VIRTUALENV=true
#echo "Checking if Python venv exists"
Expand Down
14 changes: 14 additions & 0 deletions output/rstudio/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ export JWT="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
echo "NB_PREFIX=${NB_PREFIX}" >> /opt/conda/lib/R/etc/Renviron
echo "NB_NAMESPACE=$NB_NAMESPACE" >> /opt/conda/lib/R/etc/Renviron

# change python location for vscode
pythonInterpreterPath='{"python.defaultInterpreterPath": "/opt/conda/bin/python"}'

if [ ! -d /home/jovyan/workspace/.vscode ]; then
mkdir -p /home/jovyan/workspace/.vscode;
fi

if [ ! -f /home/jovyan/workspace/.vscode/settings.json ]; then
#Not found
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
else
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
fi

# Revert forced virtualenv, was causing issues with users
#export PIP_REQUIRE_VIRTUALENV=true
#echo "Checking if Python venv exists"
Expand Down
14 changes: 14 additions & 0 deletions output/sas/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ export JWT="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
echo "NB_PREFIX=${NB_PREFIX}" >> /opt/conda/lib/R/etc/Renviron
echo "NB_NAMESPACE=$NB_NAMESPACE" >> /opt/conda/lib/R/etc/Renviron

# change python location for vscode
pythonInterpreterPath='{"python.defaultInterpreterPath": "/opt/conda/bin/python"}'

if [ ! -d /home/jovyan/workspace/.vscode ]; then
mkdir -p /home/jovyan/workspace/.vscode;
fi

if [ ! -f /home/jovyan/workspace/.vscode/settings.json ]; then
#Not found
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
else
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
fi

# Revert forced virtualenv, was causing issues with users
#export PIP_REQUIRE_VIRTUALENV=true
#echo "Checking if Python venv exists"
Expand Down
14 changes: 14 additions & 0 deletions resources/common/start-custom.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,20 @@ export JWT="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
echo "NB_PREFIX=${NB_PREFIX}" >> /opt/conda/lib/R/etc/Renviron
echo "NB_NAMESPACE=$NB_NAMESPACE" >> /opt/conda/lib/R/etc/Renviron

# change python location for vscode
pythonInterpreterPath='{"python.defaultInterpreterPath": "/opt/conda/bin/python"}'

if [ ! -d /home/jovyan/workspace/.vscode ]; then
mkdir -p /home/jovyan/workspace/.vscode;
fi

if [ ! -f /home/jovyan/workspace/.vscode/settings.json ]; then
#Not found
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
else
echo "$pythonInterpreterPath" > /home/jovyan/workspace/.vscode/settings.json
fi

# Revert forced virtualenv, was causing issues with users
#export PIP_REQUIRE_VIRTUALENV=true
#echo "Checking if Python venv exists"
Expand Down

0 comments on commit 38257f8

Please sign in to comment.