如何使python3.2解释器成为debian中的默认解释器 [英] How to make python3.2 interpreter the default interpreter in debian

查看:18
本文介绍了如何使python3.2解释器成为debian中的默认解释器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 debian 机器上安装了 python2 和 python3.但是当我尝试通过在 bash 中键入python"来调用 python 解释器时,弹出 python2 而不是 python3.由于我目前正在使用后者,因此只需键入 python 即可更轻松地调用 python3.请指导我完成此操作.

I got both python2 and python3 installed in my debian machine. But when i try to invoke the python interpreter by just typing 'python' in bash, python2 pops up and not python3. Since I am working with the latter at the moment, It would be easier to invoke python3 by just typing python. Please guide me through this.

推荐答案

唯一安全的方法是在你的 shell 中使用别名,通过放置

the only somehow safe way would be to use an alias in your shell, by placing

alias python=python3

进入你的 ~/.profile~/.bashrc...

into your ~/.profile or ~/.bashrc...

这样依赖python为python2的系统脚本不会受到影响.

this way the system scripts depending on python being python2 won't be affected.

这篇关于如何使python3.2解释器成为debian中的默认解释器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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