I want to run a script on cluster (SBATCH file).
How can activate my virtual environment (path/to/env_name/bin/activate).
Does I need only to add the following code to my_script.sh file?
module load python/2.7.14 source "/pathto/Python_directory/ENV2.7_new/bin/activate"
Yes. Just make sure to insert those lines after the SBATCH ...
lines and before any use of python
.