CentOS 7.6 compiler installed Python 3.8.0

Compile and install the actual test by Python3.8.0 on CentOS 7.6, adding Python3 soft and used Python3.

surroundings

Installation environment as follows:

  • Windows 10 Pro
  • VMWare Workstation 15 Pro
  • CentOS Linux release 7.6.1810 (Core)
  • root access, all operations are operating under the root user

CentOS 7.6 compiler installed Python 3.8.0 

Install dependencies and yum update

Installation of preparation Python3.8.

yum update

Personal habits, yum will update source before installing the package.
 
yum update

Install dependencies

Installation Python 3.8 required dependencies:
 
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel gcc make
 
CentOS 7.6 compiler installed Python 3.8.0

Download Python

In the official website to download the required version, here it is version 3.7.0
 
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0b3.tgz
 

CentOS 7.6 compiler installed Python 3.8.0Installing Python

By decompression, configuration, compiling installation step is completed

Decompression

After downloading unzip in a good directory file
 
tar -xvf Python-3.8.0b3.tgz

CentOS 7.6 compiler installed Python 3.8.0

Configuring the Compilation

Extracting into the python directory, using the `Python-3.8.0b3 / configure` configuration file
 
cd Python-3.8.0b3
 
Configuration path compilation of
 
./configure --prefix=/opt/python/python-3.8.0
 
CentOS 7.6 compiler installed Python 3.8.0
 
Note:
Here is the designated --prefix to compile the installation folder

Optimization options (optional):

On executing the step will prompt the following code to the Python interpreter to optimize the execution of the code will compile and install into  / usr / local / bin /  under, and do not add a soft link or environment variables
 
./configure --enable-optimizations
 
As shown below:
 
CentOS 7.6 compiler installed Python 3.8.0
 
CentOS 7.6 compiler installed Python 3.8.0
 

Compiling and Installing

make

CentOS 7.6 compiler installed Python 3.8.0

make install

Add soft connection

Add soft or added to the environment variables, you can use direct input python3, and add the following soft link:
 
ln -s /opt/python/python-3.8.0 /usr/bin/python3
 

Guess you like

Origin www.linuxidc.com/Linux/2019-08/160311.htm