Leif160519的blog Leif160519的blog

——————

目录
Centos7下安装Python3.7
/    

Centos7下安装Python3.7

首先安装依赖包,centos里面是-devel,如果在ubuntu下安装则要改成-dev,依赖包缺一不可,笔者曾安装python3未成功就是因为没有安装libffi-devel

sudo yum -y groupinstall "Development tools"
sudo yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel

然后获取python3.7的安装包

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0a1.tar.xz

解压

cd ~/Download
tar -xvJf  Python-3.7.0a1.tar.xz

配置python3的安装目录并安装

cd Python-3.7.0a1
./configure --prefix=/usr/local/bin/python3
sudo make
sudo make install

创建软链接

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

最后在命令行中输入python3,能够进入python3终端即成功安装


“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题Centos7下安装Python3.7
作  者Leif160519
出  处https://github.icu/articles/2019/08/28/1566986373829.html
关于博主:坐标六朝古都南京,服务器运维工程师+桌面运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!