I'm using Amazon Linux with Python 2.7.16 preinstalled. Currently, I'm doing a cron job, trying to run python in a shell script using Python 3.7.3. I have it available at /usr/local/bin/python3.7 and alias python=python3.7 in ~/.bashrc.
However, when I call which python in the shell script. I'm getting /usr/bin/python instead. I have tried export PATH="/usr/local/bin:$PATH" but failed because is searching for python instead of python3.7.
Ultimately, when I run any python command in the shell script, I would like to reference /usr/local/bin/python3.7 without explicitly refering to it.
Any help is appreciated. Thanks!
 
     
    