-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRunning python
More file actions
34 lines (26 loc) · 901 Bytes
/
Running python
File metadata and controls
34 lines (26 loc) · 901 Bytes
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
30
31
32
33
34
Step 1: Go to your folder where your python files are contained
Step 2: Create a new conda environment
module load Anaconda3/2020.11
conda create -n mypy3 python=3.8 pip
source activate mypy3
conda install ipykernel
Step 3: Stay in the virtual environment
Install numpy/scipy/pandas etc whatever your codes need
You might want to update python or pip or any other command
You can get out of the venv by writing 'conda deactivate' in the command prompt
To access the venv, use:
module load Anaconda3/2020.11
source activate mypy3
Step 4: Once in venv, and all dependencies installed the submit script should look like this:
#!/bin/bash -l
##SBATCH -p normal_q
#SBATCH -p dev_q
#SBATCH -J <JOB_NAME>.py
#SBATCH -N 1
#SBATCH --ntasks-per-node 32
#SBATCH -t 1:00:00
#SBATCH -A welbornlab
echo start load env and run python
python <CODE_NAME>.py
exit;
Step 5: Now you can submit the script. Yay!