CentOS 6.7 Installation Python3.5
1, install the package and dependent packages
Yum Groupinstall ' development Tools '#安装开发包
Yum install zlib-devel bzip2-devel openssl-devel ncurses-devel # #安装可能依赖的包
Yum Install readline-devel-y# #不安装进入python解释器的时候可能输入字符会乱码
2. Download Python3.5 Code Package
wget https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz
3 compiling
Tar jxvf python-3.5.2.tar.xz
CD Python-3.5.2
./configure--prefix=/usr/local/python3
Make && make install
4 Setting environment variables
Echo ' Export path= $PATH:/usr/local/python3/bin ' >> ~/.BASHRC
Make some necessary configuration
Rm-f/usr/bin/python # #删除老版本的软链接
Ln-s/usr/local/python3/bin/python3.5/usr/bin/python # #做新版本的软链接
5, Update the Yum configuration of python2.6.
Vim/usr/bin/yum
Change the configuration of Yum with vim
#!/usr/bin/python change to #!/usr/bin/python2.6, save Exit.
Completed the installation of the python3.
Enter Python in the Linux interface with the following information stating that the configuration is Complete.
[[email protected] py]# python
Python 3.5.2 (default, Dec 15 2016, 11:52:47)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on Linux
Type "help", "copyright", "credits" or "license" for more Information.
>>>
This article from "operation and maintenance sentiment" blog, Please be sure to keep this source http://paitoubing.blog.51cto.com/1823668/1883012
CentOS 6.7 Installation python3.5