Skip to main content

2 posts tagged with "install"

View All Tags

Install Python 3.7.5 on CentOS 7 by source tarball

· One min read

目前 CentOS 7 的 yum repo 中只有 Python 3.6.8, 项目中要使用 3.7.5, 只能从源码安装

  1. 安装依赖组件
# yum install gcc openssl-devel bzip2-devel libffi-devel
  1. 下载 Python 3.7.5 源码包, 解压 From https://www.python.org/downloads/release/python-375/
# cd /usr/src
# curl https://www.python.org/ftp/python/3.7.5/Python-3.7.5.tgz -O
# tar zxvf Python-3.7.5.tgz
  1. 配置安装
# cd /usr/src/Python-3.7.5
# ./configure --enable-optimizations
# make altinstall
  1. 创建 python 软链接

安装后的 Python 3.7 执行文件位于: /usr/local/bin/python3.7

# ln -s /usr/local/bin/python3.7 /usr/bin/python3
# ln -s /usr/bin/python3 /usr/bin/python

# python -V
Python 3.7.5
  1. 清理
# rm -f /usr/src/Python-3.7.5.tgz

Install Python 3.6 on CentOS 7

· One min read

1)安装 IUS 软件源

#安装EPEL依赖
sudo yum install epel-release

#安装IUS软件源
sudo yum install https://centos7.iuscommunity.org/ius-release.rpm

2)安装 Python3.6

sudo yum install python36u

#创建符号链接(可选)
sudo ln -s /bin/python3.6 /bin/python3

3)安装 pip3(可选)

sudo yum install python36u-pip

#创建一个到pip3的符号链接(可选)
sudo ln -s /bin/pip3.6 /bin/pip3
ClustrMaps