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.tgztar XF python-3.5.0.tgzcd python-3.5.0./configure-- Prefix=/usr/local--enable-sharedmakemake Installln–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.confldconfig
4. Run the Demo:
Python3--versionpython 3.5.0
5. Delete the libraries needed to compile Python
Yum Groupremove "Development tools"--remove-leavesyum remove Zlib-devel bzip2-devel openssl-devel ncurses-devel Sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel--remove-leaves
6, set up aliases for easy use
Alias Py=python3
This article is from the "Good Big Knife" blog, please make sure to keep this source http://53cto.blog.51cto.com/9899631/1710579
Centos6.5 Installing Python 3.5