Automated operation and maintenance [python] ------ source compiler python interpreter installation

1. Download and install python

Red Hat 1.1 will be compiled into the kernel python

If you are using a Red Hat system, then we open with a Terminal, enter python, we foundRed Hat will be compiled into the kernel python

Here Insert Picture Description

1.2 python download

But the python 2.7.5 for us somewhat outdated, python has been out to the 3.7 version, we we Wenzhongqiusheng,The most classic python3.6

1.3 compile and install

At first, weDownload an installation package python3.6 interpreterI have downloaded well, nowDecompression

Here Insert Picture Description

Here Insert Picture Description
Enter python3.6 directoryUnder ready to compile and install:

Here Insert Picture Description
Here Insert Picture Description
StartSource compiler

Here Insert Picture Description
Here Insert Picture Description
Note : We need the following compilerOption Module

./configure
--prefix=/usr/local/python3 # 将解释器编译安装在第三方软件安装目录/usr/local下
--with-ssl # 添加ssl加密

Here Insert Picture Description
Source compiler errors, lack of necessary tools to compile the source code later, weWhat little on what the installation

right nowInstall the C compiler: gcc

Here Insert Picture Description
once againCompile and install

Here Insert Picture Description
Here Insert Picture Description
Theninstallation

make && make install # 源码安装

Here Insert Picture Description
Note : Whether or installed in the compilation, weCommand must be executed in the installation package python3.6 directory

Installation errors:

Here Insert Picture Description
Install the corresponding tool:

Here Insert Picture Description
Here Insert Picture Description
At this time we have installed a success! ! !

1.4 startup command

Next we hope can be compiled just before python2 python3 like the same,Enter the command, you can directly useWe do the following:

First of allFind the boot file

Here Insert Picture Description
willStart feet added to the environment variable

1.4.1 temporarily add

Here Insert Picture Description
Here Insert Picture Description
Here Insert Picture Description
Note : Temporary added,The terminal off, or turn off the server, there is no

1.4.2 permanently added

Here Insert Picture Description
Note : When you want to write variablesOK we did not wrong, after the executable file

Here Insert Picture Description
So that our python3 interpreter completely installed successfully! ! !
.

Published 10 original articles · won praise 0 · Views 245

Guess you like

Origin blog.csdn.net/mango_kid/article/details/104710573