Install Python 7.2 in CentOS 3.6 source code
1. Environment
Install CentOS 7.2 min System (CentOS-7-x86_64-Minimal-1511.iso)
2. Requirements
Python-3.6.4.tar.xz (official website download)
GCC (yum installation)
A bunch of development libraries (yum installation)
3. Compile 3.1 to install the Compiler
yum -y install gcc
3.2 install Dependencies
yum -y install bzip2-devel sqlite-devel openssl-devel readline-devel xz-devel xz-devel tk-devel gdbm-devel
3.3 compile source code
Tar Jxvf Python-3.6.4.tar.xzcd Python-3.6.4./configure
(If you need to release the version, you need to optimize the configuration, and the compilation is slow./configure -- enable-optimizations)
make -j4make install
By default, it is installed in/usr/local.
Note: If you do not install 3.2, the system will prompt that some modules are not compiled after compilation.
Python build finished successfully!The necessary bits to build these optional modules were not found:_bz2 _curses _curses_panel _dbm _gdbm _lzma _sqlite3 _ssl _tkinter readline zlib To find the necessary bits, look in setup.py in detect_modules() for the module's name.The following modules found by detect_modules() in setup.py, have beenbuilt by the Makefile instead, as configured by the Setup files:atexit pwd time running build_scripts
4. Run
[root@py3 Python-3.6.4]# python3Python 3.6.4 (default, Jan 16 2018, 10:17:58) [GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linuxType "help", "copyright", "credits" or "license" for more information.>>>