[Jupyter/Python] How to change default python version

Easiest way to change default python version is using alias.
If you want to change default python version with using 'anaconda', then go to second headline.

simplest way to change python version on prompt

0) check python version $python --version

This is the default python version

1) $vi ~/.bashrc

2) add alias python='usr/bin/python'

Attention: after alias command, there are no spaces

3) then $source ~/.bashrc

4) check python version once more $python --version

You can find out about changed python version

change default python with anaconda

The order of file path is important.
Threfore, the change order of file path can change the default python interpreter path.

1) find out default python path on prompt. $which python

2) and then find out path order and <copy it(1)>. $echo $PATH

3) change path order.
1) Open 'bashrc' up. $vi ~/.bashrc
2) Add export PATH="<copied(1)>". Attention, the copied file pathes ordering must be changed that anaconda path behind of usr/bin.

4) $source ~/.bashrc

+ Recent posts