CentOS7安装Python3.6.5

Posted lone5wolf

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CentOS7安装Python3.6.5相关的知识,希望对你有一定的参考价值。

一、安装python3.6可能使用相关软件


# yum groupinstall ‘Development Tools‘

# yum install -y ncurses-libs zlib-devel mysql-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel


二、安装python3.6.5

# cd /usr/local

# wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz

解压:

# tar -xf Python-3.6.5.tar.xz


解压后新建文件夹将Python-3.6.5放在/usr/local/python3


进入该目录

# cd Python-3.6.5


三、执行如下代码安装


--prefix选项是配置安装的路径,执行后所有资源文件放在/usr/local/python3.6的路径中


# ./configure --prefix=/usr/local/python3 --enable-optimizations

# make

# make altinstall


四、修改软链接:


# ln -s /usr/local/python3/bin/python3  /usr/bin/python3

# ln -s /usr/local/python3/bin/pip3  /usr/bin/pip3


最后查看安装版本:


# python -V

# pip -V

 

以上是关于CentOS7安装Python3.6.5的主要内容,如果未能解决你的问题,请参考以下文章

Centos7安装python3.6.5

CentOS7安装Python3.6.5

Redhat7/centOs7 安装配置python3.6.5

python3.6.5源码安装

CentOS源码安装Python3.6

CentOS7+Python3.6利用web.py库进行微信公众平台服务器简易配置,token验证