[英]How can i remove python 2.7 as i already have 3.6.5 installed on ubuntu?
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.我同时安装了 2.7 和 3.6.5,起初在 ubuntu 18.04 中唯一可用的 python 版本是 3.6,但在我安装 numpy 包之后,2.7 也安装了,它变成了默认版本。 Is there any solution so as to make 3.6 the default one instead of 2.7??
有什么解决方案可以使 3.6 成为默认的而不是 2.7 吗??
Open .bashrc file nano ~/.bashrc
.打开 .bashrc 文件
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
.在文件顶部的新行中键入
alias python=python3
,然后使用ctrl+o
和ctrl+x
保存并关闭文件。
I set python 3 version as default using the following commands:我使用以下命令将 python 3 版本设置为默认版本:
python --version
python --version
sudo su
sudo su
update-alternatives --install /usr/bin/python python /usr/bin/python3 1
python --version
python --version
exit
to exit the root modeexit
退出root模式
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.