CentOS 7 - 安装Python 3
Enable Software Collections (SCL)
Software Collections, also known as SCL is a community project that allows you to build, install, and use multiple versions of software on the same system, without affecting system default packages. By enabling Software Collections you will gain access to the newer versions of programming languages and services which are not available in the core repositories.
CentOS 7 ships with Python 2.7.5 which is a critical part of the CentOS base system. SCL will allow you to install newer versions of python 3.x alongside the default python v2.7.5 so that system tools such as yum will continue to work properly.
In order to enable SCL we need to install the CentOS SCL release file. It is part of the CentOS extras repository and can be installed by running the following command: SCL : https://wiki.centos.org/zh/AdditionalResources/Repositories/SCL
sudo yum install centos-release-scl
Installing Python 3 on CentOS 7
Now that we have access to the SCL repository we can install any Python 3.x version we need. Currently, the following Python 3 collections are available:
- Python 3.3
- Python 3.4
- Python 3.5
- Python 3.6
In this tutorial we will install Python 3.6 which is the latest version available at the time of writing. To do so type the following command on your CentOS 7 terminal:
sudo yum install rh-python36
Using Python 3
After the package rh-python36 is installed, check the Python version by typing:
python --version
You will notice that Python 2.7 is the default Python version in your current shell.
To access Python 3.6 you need to launch a new shell instance using the Software Collection scl tool:
scl enable rh-python36 bash
What the command above does is calling the script /opt/rh/rh-python36/enable which changes the shell environment variables.
If you check the Python version again, you’ll notice that Python 3.6 is the default version in your current shell now.
It is important to point out that Python 3.6 is set as the default Python version only in this shell session. If you exit the session or open a new session from another terminal Python 2.7 will be the default Python version.
参考:
https://linuxize.com/post/how-to-install-python-3-on-centos-7/#installing-python-3-on-centos-7
https://www.centos.bz/2018/07/centos-7-%E5%AE%89%E8%A3%85-python-3-7/
CentOS 7 - 安装Python 3的更多相关文章
- centos上安装python环境
1.安装python-pip 首先安装epel扩展源: yum -y install epel-release 更新完成之后,安装pip: yum -y install python- ...
- 在CentOS上安装Python
首先我们需要在服务器上安装一个比较新的 Python,CentOS 5.8 默认装的 Python 是 2.4.3. [root@nowamagic ~]# python -V Python 我们需要 ...
- centos下安装python
下载网址:http://ftp.gnu.org/gnu/gdb/ 1.编译python必须安装开发工具 # yum groupinstall "Development tools" ...
- centos 7安装python 3
linux-Centos7安装python3并与python2共存 1.查看是否已经安装Python CentOS 7.2 默认安装了python2.7.5 因为一些命令要用它比如yum 它使用的 ...
- centos下 安装python相关
centos 安装python相关 python3 https://blog.csdn.net/tanxiaob/article/details/78725301 yum -y install zli ...
- centos如何安装python库?
通过yum install安装,先解决yum不能安装python库的问题 yum install -y epel-release #先安装epel源,参考http://sharadchhetri. ...
- centos 7 安装python 3.x
首先 安装一些 可能需要的依赖: yum -y groupinstall "Development tools" yum -y install zlib-devel bzip2-d ...
- CentOS 6 安装 python 2.7 和 mod_wsgi 运行pyocr[tesseract]
最新版本的tesseract-ocr 3.0.4 需要运行于python2.7版本以上,因此需要升级系统中默认的2.6版本python及Mod_WSGI 1,下载安装Python-2.7.10 > ...
- CentOS 6 安装 python and pip
yum update yum list python* //查看可安装python包 yum install python34.i686_64 wget https://bootstrap.p ...
- Centos下安装Python的问题汇总
Python下载地址(https://www.python.org/ftp/python/) 一.工具安装 1.Python的安装 tar vxf Python-2.7.13.tgz cd Pytho ...
随机推荐
- matlab-线性回归
1.调用函数regress(Y,X,alpha),plpha是置信度,如果直接用regress(Y,X)则默认置信度为0.05,Y是一个 的列向量,X是一个 的矩阵,其中第一列是全1向量. 2.函数返 ...
- windows下 zabbix agent心跳数据获取异常
模板中的心跳监控项默认是主动性的,在windows下直接装上客户端后,如果不协调时间,可能会出现心跳数据异常, 因为是主动式的监控,agent上的数据主动的推送到server上,但是从server上看 ...
- pycharm初识及格式化输出
#_*_coding:utf-8_*_#作者:王佃元#日期:2019/12/6 #格式化输出name = input("Name")age = input("Age&qu ...
- tornado表单和模板
模板渲染,指定模板路径: app = tornado.web.Application( handlers=[(r'/my', Myrequest),('/myweb',MywebRequest)], ...
- ESA2GJK1DH1K基础篇: Android连接MQTT简单的Demo
题外话 我老爸也问我物联网发展的趋势是什么!!!!!! 我自己感觉的:(正在朝着 "我,机器人" 这部电影的服务器方向发展) 以后的设备都会和服务器交互,就是说本地不再做处理,全部 ...
- 有这样一个url=http://item.taobao.com/item.htm?a=1&b=2&c=&d=xxx&e,请写一段js程序提取url 中的各个get参数(参数名和参数个数不确定),将其按key-value形式返回到一个json结构中, 如{a:'1',b:'2',c:'',d:'xxx',e:undefined}
第一种方法: console.log(getJson(url)); function getJson(url){ var obj={}; var arr=url.split("?" ...
- 《深度学习框架PyTorch:入门与实践》读书笔记
https://github.com/chenyuntc/pytorch-book Chapter2 :PyTorch快速入门 + Chapter3: Tensor和Autograd + Chapte ...
- TensorFlow常用激活函数及其特点和用法(6种)详解
http://c.biancheng.net/view/1911.html 每个神经元都必须有激活函数.它们为神经元提供了模拟复杂非线性数据集所必需的非线性特性.该函数取所有输入的加权和,进而生成一个 ...
- STRING Cytoscape 网络互作图
网络图(Network)看似复杂,其实构成非常简单,网络图是一种图解模型,形状如同网络,故称网络图,由节点(node)和连线(edge)两个因素组成的.其中 node 又分为 source node( ...
- Ubuntu 16.04安装ANSYS 2019 R1
参考:<ANSYS15.0 for Linux下载及安装教程> 参考链接: https://wenku.baidu.com/view/92bdf21b312b3169a451a4b5.ht ...