2025-10-20 03:23:45 +00:00
|
|
|
#!/bin/bash
|
2025-10-22 15:05:23 +00:00
|
|
|
#
|
|
|
|
|
# This script creates the venv and then starts JupyterLab
|
|
|
|
|
# The other script, t.sh, starts JupyterLab using an existing venv
|
|
|
|
|
|
2025-10-20 03:23:45 +00:00
|
|
|
if [ -d .venv ]; then
|
2025-10-22 15:05:23 +00:00
|
|
|
rm -rf .venv 2>/dev/null
|
|
|
|
|
rm -rf .venv 2>/dev/null
|
2025-10-20 03:23:45 +00:00
|
|
|
fi
|
|
|
|
|
|
2025-10-22 15:05:23 +00:00
|
|
|
# UNAMESTR=$(uname)
|
|
|
|
|
if [ "$(uname)" = 'Darwin' ]; then
|
|
|
|
|
# echo "Using $which(python3) to create venv"
|
|
|
|
|
echo "Using $(python3 --version) to create venv"
|
|
|
|
|
python3 -m venv .venv --upgrade-deps
|
|
|
|
|
else
|
|
|
|
|
echo "Using $(python --version) to create venv"
|
|
|
|
|
python -m venv .venv --upgrade-deps
|
|
|
|
|
fi
|
|
|
|
|
echo ""
|
2025-10-20 03:23:45 +00:00
|
|
|
|
2025-10-22 15:05:23 +00:00
|
|
|
# Set environment variables that JupyterLab will use to find config data
|
2025-10-20 03:23:45 +00:00
|
|
|
export JUPYTERLAB_SETTINGS_DIR="${PWD}/.jupyter/lab/user-settings"
|
|
|
|
|
export JUPYTER_DATA_DIR="${PWD}/.jupyter/data"
|
|
|
|
|
export JUPYTER_CONFIG_DIR="${PWD}/.jupyter"
|
|
|
|
|
|
2025-10-22 15:05:23 +00:00
|
|
|
# Activate the virtual environment
|
|
|
|
|
if [ "$(uname)" = 'Darwin' ]; then
|
|
|
|
|
. .venv/bin/activate
|
|
|
|
|
else
|
|
|
|
|
. .venv/Scripts/activate
|
|
|
|
|
fi
|
2025-10-20 03:23:45 +00:00
|
|
|
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
|
|
|
|
|
jupyter lab
|