I'm on a mac when I normally run
Jupyter notebook #or
python #or
python3
which python # === /Users/myname/anaconda3/bin/python
This works as expected with python 3.6 being used.
HOWEVER, when I setup my python code to run via a cronjob I am running into errors as some of my code is NOT compatible with 2.7 vs 3.6. I'm noticing that my python script in my cronjob is being run with 2.7.
Obviously this is somewhat basic, but CAN'T figure out how to ensure that my python code that is run via cronjob is executed in Python3 vs Python2.
I run
vim ~/bash_profile and I see all of the following
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH
# Setting PATH for Python 3.4
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
export PATH
# added by Anaconda3 2.0.1 installer
export PATH="/Users/myname/anaconda/bin:$PATH"
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
# added by Anaconda 2.0.1 installer
export PATH="/Users/myname/anaconda/bin:$PATH"
# added by Anaconda 2.1.0 installer
export PATH="/Users/myname/anaconda/bin:$PATH"
# added by Anaconda2 4.1.1 installer
export PATH="/Users/myname/anaconda/bin:$PATH"
# added by Anaconda3 5.0.0 installer
export PATH="/Users/myname/anaconda3/bin:$PATH"
What do I need to change so that chronjobs are run with 3.6?