centos7编译安装Python3.6(与2.7并存)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos7编译安装Python3.6(与2.7并存)相关的知识,希望对你有一定的参考价值。
首先去官网下载python3.6
https://www.python.org/
环境准备:#yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel
mkdir /usr/local/python3
准备安装python
./configure --prefix=/usr/local/python3 --enable-optimizations
make
makeinstall
ln -s /usr/local/python3/bin/python3.6 /usr/bin/python3
ln -s /usr/local/python3/bin/pip /usr/bin/pip3
cd /usr/bin
mv python python.bak
mv python3 python
在etc/profile最后一行中加入变量
export PATH="$PATH:/usr/local/python3/bin"
输入Python
>>>python 3.6
输入pip3 -V 检查是否安装成功
以上是关于centos7编译安装Python3.6(与2.7并存)的主要内容,如果未能解决你的问题,请参考以下文章
Centos7.4系统Python2.7升级Python3.6(编译安装)