Reputation: 2977
Without root access, how do I change the default Python from 3.5 to 2.7 for my specific user? Would like to know how to run Python scripts with Python 2 as well.
If I start up Python by running simply python
then it runs 3.5.2. I have to specifically run python2
at the terminal prompt to get a version of python2 up.
If I run which python
, then /data/apps/anaconda3/bin/python
gets returned and I believe Python 2.7 is under /usr/bin/python
.
This is on CentOS if that helps clarify anything
Upvotes: 3
Views: 6556
Reputation: 1525
If you are looking to change the python interpreter in anaconda from 3.5 to 2.7 for the user, try the command conda install python=2.7
Upvotes: 1
Reputation: 12140
You can add
alias python=python2.7
to your .bashrc file in home folder
Upvotes: 3