generated from VectorInstitute/aieng-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
venv.sh
29 lines (21 loc) · 1023 Bytes
/
venv.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!bin/bash
# Load python module if you are on Vector cluster and install poetry
module load python/3.10.12
pip install poetry
# Optional: it's recommended to change the cache directory to somewhere in the scratch space to avoid
# running out of space in your home directory, below is an example for the Vector cluster
mkdir -p /scratch/ssd004/scratch/$(whoami)/poetry_cache
export POETRY_CACHE_DIR=/scratch/ssd004/scratch/$(whoami)/poetry_cache
# To see if the cache directory is set correctly, run the following command
# poetry config cache-dir
echo "Cache directory set to: $(poetry config cache-dir)"
# Install dependencies via poetry
poetry install
# Activate the virtual environment
poetry shell
# Deactivate the virtual environment
# deactivate
# To check where your virtual environment is located, run the following command
# poetry env info --path
# Alternatively, to activate your virtual environment without running poetry shell, run the following command
# source $(poetry env info --path)/bin/activate