Install python3.x.x under Linux

Source: Internet
Author: User

Linux comes with Python in general, but 2014 years ago, Linux comes with Python 2.x.x and even earlier versions.


You need to use python3.x.x to download the installation yourself.


Online there is a direct download of Python on the official website method, the test failed to change a few versions of the download or failure.

code snippets that cannot be implemented : wget http://www.python.org/ftp/python/3.3.2/Python-3.3.2.tar.bz2


It is possible to : You can find python3.x.x Linux files online now, upload to Linux system, then install python3.x.x


Download the source tar package first

To find online, the following download link is valid: http://xiazai.zol.com.cn/detail/33/320958.shtml


I downloaded the python-3.1.2.tar.bz2 version, downloaded to the download directory, unzip


BUNZIP2 python-3.1.2.tar.bz2

TAR-XVF Python-3.1.2.tar

  

Go to the Unpacked folder

CD Python-3.1.2


Build a folder in/usr/local before compiling Python3 (as a Python installation path to avoid overwriting the old version)

Mkdir/usr/local/python3

  

Start compiling the installation

./configure--prefix=/usr/local/python3

Make

Make install


The old version is not overwritten at this time, then the original/usr/bin/python link is changed to another name

Mv/usr/bin/python/usr/bin/python_old


Link to build a new version of Python

Ln-s/usr/local/python3/bin/python3/usr/bin/python


Enter Python at this time

The new version of Python will be displayed.


[[email protected] python-3.1.2]# Python

Python 3.1.2 (r312:79147, Dec 2 2014, 11:31:20)

[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2

Type "Help", "copyright", "credits" or "license" for more information.

>>> quit ()


PS: If you do not set up a new installation path Python3, but the direct default installation, the installation of the new Python should be overwritten with the old version of Linux, or may not overwrite, specific to the installation process, this can be tested on their own, if you want to retain the original version, this method is best.

Install python3.x.x under Linux

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.