CentOS 6.7 Installation python3.5

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.