Reputation: 51
i have both 2.7 as well as 3.6.5 installed , at first in ubuntu 18.04 the only python version available was 3.6 but after i installed numpy package, along with it 2.7 got installed as well and it turned into default. Is there any solution so as to make 3.6 the default one instead of 2.7??
Upvotes: 4
Views: 18764
Reputation: 41
I set python 3 version as default using the following commands:
python --version
sudo su
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
python --version
exit
to exit the root modeUpvotes: 4
Reputation: 1384
Open .bashrc file nano ~/.bashrc
. Type alias python=python3
on to a new line at the top of the file then save and close the file with ctrl+o
and ctrl+x
.
Upvotes: 18