如何使python3命令运行Python 3.6而不是3.5? [英] How to make python3 command run Python 3.6 instead of 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 stillPython 3.5.3
. How can I makepython3
point toPython 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屋!