欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

centos7 安装 python3.7

程序员文章站 2022-03-11 22:38:56
...
  1. 安装libffi-devel依赖
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel gcc make
  1. 下载、解压压缩包
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar -xvJf Python-3.7.0.tar.xz
cd Python-3.7.0
  1. 编译安装
./configure --prefix=/usr/local/python3
make && make install
  1. 创建软链接
ln -s /usr/local/python3/bin/python3 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
  1. 运行
python3