CentOS7 安装Python开发环境

作者:小橘猫 | 创建时间: 2023-06-23
基于CentOS7安装配置Python开发环境...
CentOS7 安装Python开发环境

操作方法

1、使用xshell登录到我们的CentOS7系统 2、添加CentOS SCLo存储库 [root@linuprobe ~]# yum -y install centos-release-scl-rh centos-release-scl

3、使用yum安装python3.3 [root@linuprobe ~]# scl enable python33 bash #加载环境变量 [root@linuprobe ~]# python -V Python 3.3.2 [root@linuprobe ~]# which python /opt/rh/python33/root/usr/bin/python [root@linuprobe ~]# vi /etc/profile.d/python33.sh #!/bin/bash source /opt/rh/python33/enable export X_SCLS="`scl enable python33 'echo $X_SCLS'`"

4、使用yum安装python [root@linuprobe ~]# scl enable python34  bash #加载环境变量 [root@linuprobe ~]# python -V Python 3.4.2 [root@linuprobe ~]# which python /opt/rh/python34 /root/usr/bin/python [root@linuprobe ~]# vi /etc/profile.d/python34 .sh #!/bin/bash source /opt/rh/python34 /enable export X_SCLS="`scl enable python34  'echo $X_SCLS'`"

5、使用yum安装Python3.5 [root@linuprobe ~]# scl enable python35  bash #加载环境变量 [root@linuprobe ~]# python -V Python 3.5.1 [root@linuprobe ~]# which python /opt/rh/python35 /root/usr/bin/python [root@linuprobe ~]# vi /etc/profile.d/python35 .sh #!/bin/bash source /opt/rh/python35 /enable export X_SCLS="`scl enable python35  'echo $X_SCLS'`"

温馨提示

注意安装其他版本的python建议卸载系统默认的python
点击展开全文

更多推荐