Making Python3 default in Ubuntu

I came into the python world at 2017, and ever since then, I have never thought of using Python2. Now in 2020, I just updated my OS to Ubuntu 20.04 and I have no idea what python2 is doing on my terminal, talkless of even being the default.


But this is how I made python3 my default:

First I typed gedit ~/.bashrc on my terminal to open the .bashrc file on my text editor.

<span>$ </span>gedit ~/.bashrc
<span>$ </span>gedit ~/.bashrc
$ gedit ~/.bashrc

Enter fullscreen mode Exit fullscreen mode

And then I added
alias python=python3
to the top of the .bashrc file and saved it.

That was it.

What this means is that whenever I write python on my terminal, it sees it as python3

原文链接:Making Python3 default in Ubuntu

© 版权声明
THE END
喜欢就支持一下吧
点赞13 分享
It doesn't matter how slow you are, as long as you're determined to get there, you'll get there.
不管你有多慢,都不要紧,只要你有决心,你最终都会到达想去的地方
评论 抢沙发

请登录后发表评论

    暂无评论内容