如何使python3命令运行Python 3.6而不是3.5? [英] How to make python3 command run Python 3.6 instead of 3.5?

查看:672
本文介绍了如何使python3命令运行Python 3.6而不是3.5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚下载了Python 3.6.1,但是当我在终端中键入 python3 -V 时,它仍然是 Python 3.5.3 。如何使 python3 指向 Python 3.6 ?所有版本都在 / usr / bin / 目录中。

解决方案

do

  rm / usr / bin / python3 
ln -s /usr/bin/python3.6 / usr / bin / python3

更好的解决方案



嗯,Python在Ubuntu的大部分用于系统脚本和软件,而软件依赖于在某个特定的地方拥有Python(以及启动Python的命令)。然后做

  rm / usr / bin / python3 
ln -s /usr/bin/python3.5 / usr / bin / python3

〜/ .bash_aliases中创建别名

 别名python3 ='/ usr / bin / python3.6'
/ pre>

脚本可以从以下开始:

  !/ usr / bin / env python3 


I just downloaded Python 3.6.1, but when I type python3 -V in the terminal it's still Python 3.5.3. How can I make python3 point to Python 3.6? All versions are in the /usr/bin/ directory.

解决方案

do

rm /usr/bin/python3
ln -s /usr/bin/python3.6 /usr/bin/python3

much better solution:

Damn, Python is used throughout much of Ubuntu for system scripts and software, and software relies on having Python (and the commands to start Python) in a certain spot. do back then.

rm /usr/bin/python3 
ln -s /usr/bin/python3.5 /usr/bin/python3 

create alias in ~/.bash_aliases

alias python3='/usr/bin/python3.6' 

Scripts can then start with something like:

#!/usr/bin/env python3 

这篇关于如何使python3命令运行Python 3.6而不是3.5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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