Ubuntu更换python默认版本
设置python版本:
1 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2 100
2 sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 150
切换python版本
1 sudo update-alternatives --config python
按照提示输入编号即可
1 有 2 个候选项可用于替换 python (提供 /usr/bin/python)。
2
3 选择 路径 优先级 状态
4 ------------------------------------------------------------
5 * 0 /usr/bin/python3 150 自动模式
6 1 /usr/bin/python2 100 手动模式
7 2 /usr/bin/python3 150 手动模式
8
9 要维持当前值[*]请按<回车键>,或者键入选择的编号:0
10 bing@bing-Lenovo:~/download$ python
11 Python 3.6.7 (default, Oct 25 2018, 09:16:13)
12 [GCC 5.4.0 20160609] on linux
13 Type "help", "copyright", "credits" or "license" for more information.
14 >>> exit()
这样你甚至可以将自己喜欢的任意版本python安装到任意位置,然后使用update-alternatives将其设置为系统默认python
Ubuntu更换python默认版本的更多相关文章
- 切换Ubuntu系统python默认版本的方法
另附切换系统python默认版本的方法: 先使用命令: update-alternatives --list python 查看python命令的各种可能结果, 例如我的结果: /usr/bin/py ...
- Ubuntu更换python版本
Ubuntu更换python版本 ubuntu服务器自带的python版本是python3.6,在运行jwt包时会有版本问题,所以安装和本地相同的python版本=>python3.7 安装py ...
- Linux系统中python默认版本为python2.7,修改为python3 项目上传码云
# 查询系统本系统中安装的python版本 ls -l /usr/bin/python* 1.在虚拟机上新建虚拟环境 # 系统中python默认版本为python2.,可以将其修改为python3 # ...
- Python默认版本修改
Python默认版本修改 当电脑安装了多个版本的Python,而Shell中默认的Python不是你想要的,这个时候就需要对Python的默认版本进行修改. 在Windows中,可以通过修改环境变量的 ...
- Linux配置Python默认版本
我们知道在Windows下多版本共存的配置方法就是改可执行文件的名字,配置环境变量. Linux中的配置原理差不多,思路就是生成软链接,配置到环境变量. 在没配置之前,我的Ubuntu中安装了pyth ...
- Python默认版本切换
Mac上自带python2.7 版本,但是我又下了一个3.7版本(下载的版本默认安装在 /Library/Frameworks/Python.framework/Versions/3.7/bin/py ...
- Linux下python默认版本切换成替代版本
本文链接自http://www.myhack58.com/Article/48/66/2016/71806.htm 当你安装 Debian Linux 时,安装过程有可能同时为你提供多个可用的 Pyt ...
- 将Linux下python默认版本切换成替代版本
本文链接自http://www.myhack58.com/Article/48/66/2016/71806.htm 当你安装 Debian Linux 时,安装过程有可能同时为你提供多个可用的 Pyt ...
- CentOS系统python默认版本由python2改为python3
一.了解 CentOS中如果安装有yum,一般会有python2的某个版本.命令行键入python,出现的python2的环境: [root@instance-hrnebyqu src]# pytho ...
随机推荐
- RuntimeError already started
Env: os: Ubuntu python3 pytorch vscode Desc 在上述环境中运行A3C多进程模型,使用命令行时没问题,使用vscode时出现 'RuntimeError: al ...
- 解决关闭ssh后网页停止服务的方法,利用nohup
上一篇文章提到宝塔面板无法运行,只能用ssh运行app.py. 关闭ssh时,app.py会被杀死.因为app.py的父进程就是ssh,关掉ssh会造成进程被杀死. 解决方法参考 https://w ...
- JavaScript事件:事件处理模型(冒泡、捕获)、取消冒泡、阻止默认事件
(一)事件处理模型---事件冒泡.捕获 (1)事件冒泡 24 <body> 25 <div class="warpper"> 26 <div clas ...
- POJ 3415 Common Substrings(后缀数组 + 单调栈)题解
题意: 给两个串\(A.B\),问你长度\(>=k\)的有几对公共子串 思路: 先想一个朴素算法: 把\(B\)接在\(A\)后面,然后去跑后缀数组,得到\(height\)数组,那么直接\(r ...
- 使用opencv-python实现MATLAB的fspecial('Gaussian', [r, c], sigma)
reference_opencv实现高斯核 reference_MATLAB_fspecial函数说明 # MATLAB H = fspecial('Gaussian', [r, c], sigma) ...
- Apple Watch Series 6 屏幕误触放大后无法还原问题和解决方案
Apple Watch Series 6 屏幕误触放大后无法还原问题和解决方案 shit Apple,只能放大,不能缩小! 解决方案 关闭缩放功能 https://support.apple.com/ ...
- JAMstack (JavaScript + APIs + Markup)
JAMstack (JavaScript + APIs + Markup) The modern way to build Websites and Apps that delivers better ...
- 如何用 js 实现一个 new 函数
如何用 js 实现一个 new 函数 原理 new 关键字实现经过了如下过程 创建一个空对象 obj = {} 链接到原型 obj.proto = constructor.prototype 绑定 t ...
- leetcode best solutions
leetcode best solutions how to learning algorithms form the leetcode best solutions https://leetcode ...
- ts 在Function上创建静态属性和方法
interface IMessage { (value: any): void; success(): void; error(): void; version: string; } const Me ...