Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)

I was attempting to set the default python variant to python3 in Ubuntu 16.04. As a matter of course, it is python2 (2.7). I followed the underneath steps : 

update-alternatives --remove python /usr/bin/python2

update-alternatives --install /usr/bin/python python /usr/bin/python3

however, I'm getting the accompanying blunder for the subsequent assertion, 

rejeesh@rejeesh-Vostro-1015:~$ update-alternatives --install /usr/bin/python python /usr/bin/python3

update-alternatives: --install needs <link> <name> <path> <priority>

Use 'update-alternatives --help' for program usage information.   

I'm new to Ubuntu and I don't have the foggiest idea what I'm fouling up. 

1 Answer

0 votes
by (26.4k points)

I Suggest, update-alternatives is the better method to do this. 

Open your .bashrc document nano ~/.bashrc. Type alias python=python3 onto another line at the highest point of the document at that point spare the record with ctrl+o and close the document with ctrl+x. At that point, back at your order line type source ~/.bashrc. Presently your assumed name should be lasting.

Want to learn python in detail? Join python online course now!
For more details, do check it out..

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...