This repository has been archived on 2024-04-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
Jupyter-Notebooks/run.sh
T
2023-04-05 20:24:27 +02:00

28 lines
771 B
Bash
Executable File

#!/bin/bash
envFolder=".venv"
init_venv() {
if [ ! -d "$PWD/$envFolder" ]; then
echo "Initializing virtual environment..."
python3 -m venv "$PWD/$envFolder"
#update_pip
fi
}
update_pip() {
if [ -f "$PWD/$envFolder/bin/pip" ]; then
echo "Updating pip..."
"$PWD/$envFolder/bin/python" -m pip install --upgrade pip >> /dev/null
fi
if [ -f "$PWD/requirements.txt" ]; then
echo "Installing modules..."
"$PWD/$envFolder/bin/python" -m pip install -r "$PWD/requirements.txt" >> /dev/null
else
echo "No requirements found, installing pip-autoremove..."
"$PWD/$envFolder/bin/python" -m pip install "pip-autoremove" >> /dev/null
"$PWD/$envFolder/bin/python" -m pip freeze > "$PWD/requirements.txt"
fi
}
init_venv
jupyter lab