I am trying to execute a python script in a conda enviroment on a SLURM cluster. So far any suggestions I found online couldn't solve my problem. I set up my conda enviroment and installed all necessary packages. To keep it simple, let's say that my python script contains only the line import torch. The necessary packages are installed in the enviroment (the script runs smoothly on my local computer). I installed Miniconda if this is important. My bash file contains after #!/bin/sh and several #SBATCH commands the following lines: source /path/to/.bashrc conda activate myenv python3 /path/to/test.py But then I get the error message that the file .bashrc doesn't exist. If I delete the lines source /path/to/.bashrc conda activate myenv and execute the bash file from the activated enviroment myenv I get the error message that it cannot find the module torch.... Any help would be appreciated... Continue reading...