1. CentOS6.5 install Python's dependency package
Yum Groupinstall "Development tools"
Yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel Libpcap-devel Xz-devel
2, download the Python3.5 source package and compile
wget https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz
Tar XF python-3.5.0.tgz
CD Python-3.5.0
./configure--prefix=/usr/local--enable-shared
Make
Make install
Ln–s/usr/local/bin/python3/usr/bin/python3
3. You need to configure the library before running Python:
Echo/usr/local/lib >>/etc/ld.so.conf.d/local.conf
Ldconfig
4. Run the Demo:
Python3--version
Python 3.5.0
5. Delete the libraries needed to compile Python
Yum Groupremove "Development tools"--remove-leaveas
Yum Remove Zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel L Ibpcap-devel Xz-devel--remove-leaves
6, set up aliases for easy use
Alias Py=python3
You may also like the following articles about Python, so take a look at:
Installation and considerations for Python under Linux http://www.linuxidc.com/Linux/2015-11/124861.htm
Ubuntu 14.04 under installation using the Python RQ module http://www.linuxidc.com/Linux/2015-08/122441.htm
Run Python code directly without operating system http://www.linuxidc.com/Linux/2015-05/117357.htm
CentOS on source installation Python3.4 http://www.linuxidc.com/Linux/2015-01/111870.htm
The second edition of Python core programming. (Wesley J. Chun). [HD PDF Chinese] http://www.linuxidc.com/Linux/2013-06/85425.htm
Installing python3.5 under CentOS 6.5