基础服务系列-Centos7 安装Python3.7

2019/07/20

Python 3.7.0 is the newest major release of the Python language, and it contains many new features and optimizations.

简介

官方centos镜像为基础,安装Python3.7.0

更换yum源

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

安装wget

yum install wget

下载

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

安装

  1. 解压

    tar -xvf Python-3.7.0.tgz

  2. 移动

    mv Python-3.7.0 /usr/local

  3. 执行

    ./configure

    configure: error: no acceptable C compiler found in $PATH

    yum install gcc

    ./configure

  4. 编译

    yum install make

    make

  5. 安装

    make install

    zipimport.ZipImportError: can't decompress data; zlib not available yum install zlib* -y

    ModuleNotFoundError: No module named '_ctypes'

    yum install libffi-devel -y

    make install

  6. 建立软连接

    ln -s /usr/local/Python-3.7.0/python /usr/bin/python3

  7. 验证

保存镜像

参考

CentOS7安装Python3.7

Centos7- wget未找到命令,there are no enabled repos 解决办法

Install Python PIP on CentOS7


作者:Wuxinshui
出处:http://wuxinshui.github.io
版权归作者所有,转载请注明出处

Post Directory