Thanks, Gael! You are very kind for taking the time to answer my post. However, it was not the upper or lower case that made a difference in my case. Actually, I solved the issue with the following line:
Hi Monika,
the module command lets you manage the software versions you want to use. In your case, you’re only loading a different version of python installed by default on the server.
According to the following tests, it’s python in lower case that works (regardless of the version used)
## check command
(baobab)-[alberta@login2 ~]$ Python --version
-bash: Python: command not found
(baobab)-[alberta@login2 ~]$ python --version
Python 3.6.8
(baobab)-[alberta@login2 ~]$ module load GCC/8.2.0-2.31.1 OpenMPI/3.1.3 Python/3.7.2 SciPy-bundle/2019.03
(baobab)-[alberta@login2 ~]$ Python --version
-bash: Python: command not found
(baobab)-[alberta@login2 ~]$ python --version
Python 3.7.2
## Launching job on debug-cpu
(baobab)-[alberta@login2 ~]$ srun Python --version
srun: job 9927929 queued and waiting for resources
srun: job 9927929 has been allocated resources
slurmstepd: error: execve(): Python: No such file or directory
srun: error: cpu001: task 0: Exited with exit code 2
(baobab)-[alberta@login2 ~]$ srun python --version
srun: job 9927931 queued and waiting for resources
srun: job 9927931 has been allocated resources
Python 3.7.2