1.python3 and Python2 can coexist without deleting their own python2
Server Linux under the default system comes with python2.6 version, this version of the system is dependent on many programs, so it is not recommended to delete.
If you are using the latest Python3 then we know that there is no effect between compiling and installing the source package and the system default package.
2. Download the Python3 source package on the website
Website: https://www.python.org/
Then click on the downloads in the navigation bar,
You can also click on the Downloads pop-up menu to select Source Code,
is the source package meaning, here choose the latest version 3.5.6,
There are also many other historical versions of the following,
Click on the page below to see the download link,
Includes source package, Mac OSX installation package, Windows installation package
Here you select the first (gzipped source tarball) Download,
Download is the source package: python-3.5.6.tgz.
3. Pre-installation preparation to ensure that our system has all the necessary development dependencies
CentOS 7:
#yum-y groupinstall#yum-y install Zlib-devel
Debian:
#aptitude-y install gcc make Zlib1g-dev
4. upload python-3.5.6.tgz to the server, ready to install
(Friendly recommendation Bitvise server file visualization software)
-xvzf Python-3.5.6. tgz Enter directory: cd Python-3.5.6/ Add configuration: (Configure your own installation directory here). /configure--prefix=/usr/python next compile Source: Make perform installation: make install
The whole process is about 5-10 minutes,
After the installation is successful, the installation directory is/usr/python
5. Verify that it is installed as
# which Python3 # python3-v
That is OK
6. Exit
quit () or exit ()
Server (Linux) installation Python3