Centos yum安装python3.6

适用于Centos6/7

1、配置好epel源和ius源

# Centos 6
yum install https://centos6.iuscommunity.org/ius-release.rpm -y
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

# Centos 7
yum install https://centos7.iuscommunity.org/ius-release.rpm -y

2、安装Python3.6

yum install python36u -y

# 创建软链接
ln -s /usr/bin/python3.6 /bin/python3

3、安装pip3

yum install python36u-pip -y

# 创建软链接
ln -s /usr/bin/pip3.6 /bin/pip3

# 升级pip
pip3 install --upgrade pip

4、安装virtualenv

pip3 install virtualenv

5、配置java环境

# 先下载jdk包,解压缩后解压目录放入环境变量中

vim /etc/profile
#java environment
export JAVA_HOME=/usr/java/jdk1.8.0_171
export CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
export PATH=$PATH:${JAVA_HOME}/bin

source /etc/profile
java -version

6、升级内核

yum update -y kernel-tools kernel-devel kernel python-perf kernel-headers kernel-tools-libs

你可能感兴趣的:(Python,Linux)