我如何删除 python 2.7,因为我已经在 ubuntu 上安装了 3.6.5? [英] How can i remove python 2.7 as i already have 3.6.5 installed on ubuntu?

查看:70
本文介绍了我如何删除 python 2.7,因为我已经在 ubuntu 上安装了 3.6.5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我同时安装了 2.7 和 3.6.5,起初在 ubuntu 18.04 中唯一可用的 python 版本是 3.6,但是在我安装了 numpy 包之后,2.7 也安装了,它变成了默认版本.有什么解决方案可以使 3.6 成为默认的而不是 2.7??

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??

推荐答案

打开 .bashrc 文件 nano ~/.bashrc.在文件顶部的新行中输入 alias python=python3,然后使用 ctrl+octrl+x 保存并关闭文件>.

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.

这篇关于我如何删除 python 2.7,因为我已经在 ubuntu 上安装了 3.6.5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆