CentOS 7下安装Python3.6.4

Posted lenmom

tags:

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

CentOS 7下安装Python3.6.4

•安装python3.6可能使用的依赖

yum install -y openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel  wget

 

•到python官网找到下载路径, 用wget下载

wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz

•解压tgz包

tar -zxvf Python-3.6.4.tgz

•把python移到/usr/local下面

mv Python-3.6.4 /usr/local

•删除旧版本的python依赖

ll /usr/bin | grep python

rm -rf /usr/bin/python

•进入python目录

cd /usr/local/Python-3.6.4/

•配置

./configure

•编译 make

make

•编译,安装

make install

•删除旧的软链接,创建新的软链接到最新的python

rm -rf /usr/bin/python

ln -s /usr/local/bin/python3.6 /usr/bin/python

python -V

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

CentOS7下安装Python3.6.4

linux下安装python3.6.4

centos6安装python3.6.4

Ubuntu16.04下安装python3.6.4详细步骤

Linux下安装Python3.6.4步骤

05 Windows安装python3.6.4+pycharm环境