CentOS6.5 install Python3

Source: Internet
Author: User
Install Environment yuminstallgccyuminstallzlib-develyuminstallmake download python version wgethttp: // www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz
  1. Installation environment
    Yum install gcc
    Yum install zlib-devel
    Yum install make

  2. Download python
    Wget http://www.python.org/ftp/python/3.4.0/Python-3.4.0.tgz

  3. Decompress, compile, and install
    Tar-zxvf Python-3.4.0.tgz
    Cd Python-3.4.0
    ./Configure-prefix =/opt/python3
    Make all
    Make install
    Clear the previously compiled executable files and configuration files.
    Make clean
    Clear all generated files
    Make distclean

  4. View installed new version information
    /Opt/python3/bin/python3-V
    Python 3.4.0
    The new version of python compilation and installation takes effect.

  5. Make a soft connection to the bin directory of the current user
    Ln-s/opt/python3/bin/python3 ~ /Bin/python3

  6. After the new python version is upgraded and installed, the default value is still python2.6.
    #! /Usr/bin/python #! /Opt/python3/bin/python3.

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.