Install Python 7.2 in CentOS 3.6 source code

Source: Internet
Author: User

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.>>> 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.