#!/bin/bash # # This script creates the venv and then starts JupyterLab # The other script, t.sh, starts JupyterLab using an existing venv if [ -d .venv ]; then rm -rf .venv 2>/dev/null rm -rf .venv 2>/dev/null fi # 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 "" # Set environment variables that JupyterLab will use to find config data export JUPYTERLAB_SETTINGS_DIR="${PWD}/.jupyter/lab/user-settings" export JUPYTER_DATA_DIR="${PWD}/.jupyter/data" export JUPYTER_CONFIG_DIR="${PWD}/.jupyter" # Activate the virtual environment if [ "$(uname)" = 'Darwin' ]; then . .venv/bin/activate else . .venv/Scripts/activate fi pip install -r requirements.txt jupyter lab