简单记录一下centos7安装python3的步骤

[python] 2024-06-22 圈点793

摘要:简单记录一下centos7安装python3的步骤

简单记录一下centos7安装python3的步骤


原因,系统本身自带的是2.7的,需要安装高版本的python3,记录一下思路和步骤:


1,配置地基


yum install gcc openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel libffi-devel tk-devel wget curl-devel


2. 下载并解压

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

tar -zxvf Python-3.7.2.tgz 


3,创建安装目录

mkdir /usr/local/python3


4,编译安装

Python-3.7.2/configure --prefix=/usr/local/python3/

make

make install


5. 建一个软链接方便使用

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

就可以用:python3


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

也可以用pip3了


centos7  python3  

感谢反馈,已提交成功,审核后即会显示