联网环境下编译安装python3.7.2,不联网则需要配置cnetos7.9离线源
下载解压软件包
[root@localhost ~]# tar -xf Python-3.7.3.tar.gz
[root@localhost ~]# ls
anaconda-ks.cfg Python-3.7.3 Python-3.7.3.tar.gz
[root@localhost ~]#
[root@localhost ~]# cd Python-3.7.3
[root@localhost Python-3.7.3]# ls
aclocal.m4 config.sub Doc install-sh m4 Misc Parser Programs README.rst
CODE_OF_CONDUCT.rst configure Grammar Lib Mac Modules PC pyconfig.h.in setup.py
config.guess configure.ac Include LICENSE Makefile.pre.in Objects PCbuild Python Tools
[root@localhost Python-3.7.3]#
安装依赖
[root@localhost Python-3.7.3]# yum install -y zlib zlib-devel gcc libffi libffi-devel
编译安装文章来源:https://www.toymoban.com/news/detail-740474.html
[root@localhost Python-3.7.3]# ./configure
[root@localhost Python-3.7.3]# make
[root@localhost Python-3.7.3]# make install
验证文章来源地址https://www.toymoban.com/news/detail-740474.html
[root@localhost Python-3.7.3]# python3 --version
Python 3.7.3
[root@localhost Python-3.7.3]# python3
Python 3.7.3 (default, Nov 2 2023, 10:28:15)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
到了这里,关于centos7.9编译安装python3.7.2的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!