-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathproject_activate
executable file
·20 lines (17 loc) · 1.09 KB
/
project_activate
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
#
# This is a poor-man's version of
# [python venv](https://docs.python.org/3/tutorial/venv.html),
# [conda environments](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
# and/or `module load ...` environements like [lmod](https://lmod.readthedocs.io/en/latest/010_user.html) available on many clusters.
# Depending on your cluster setup, one of those solutions might be better suited for your case.
#
# To use it, source this file form the command line with `. project_activate` or equivalently `source project_activate` from the terminal.
# Anything within that terminal will then have the environment variables below set.
# set the base path to the project
export PROJECT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" # the folder where this script is
# this allows to directly call `cluster_jobs.py submit ...` even from other directories
export PATH="$PROJECT_DIR:$PATH"
# if needed, adjust more, e.g.
# export PATH="/mount/packs/intelpython3/bin:$PYTHONPATH"
export PYTHONPATH="$PROJECT_DIR${PYTHONPATH:+:$PYTHONPATH}"