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

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

问题描述

我的debian机器中安装了python2和python3。但是当我尝试通过在bash中键入python来调用python解释器时,python2弹出而不是python3。由于我正在与之配合使用,所以只需键入python就可以调用python3。请指导我解决这个问题。

解决方案

只有以某种方式安全的方式是在shell中使用别名, p>

 别名python = python3 

到您的〜/ .profile 〜/ .bashrc ...



这样,依赖于python是python2的系统脚本不会受到影响。


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.

解决方案

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

alias python=python3

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

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

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

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