CentOS 7 Installation python3.6.1

Source: Internet
Author: User

Description: CentOS 7 minimized installation, default Python 2.7, development requires installation of python3.6.1.

1. Check Python version

[Email protected] ~]# python-v
Python 2.7.5
[Email protected] ~]#

2. Install the necessary library files

# yum-y Install zlib zlib-devel gcc

3. Download python3.6.1 to/usr/local directory

# wget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/3.6.1/PYTHON-3.6.1.TAR.XZ

4. Decompression and Installation

# xz-d PYTHON-3.6.1.TAR.XZ

# TAR-XVF Python-3.6.1.tar

# CD PYTHON-3.6.1/

#./configure Prefix=/usr/local/python3

# Make && make install

5. Add Environment Variables Permanently

# Vim/etc/profile

Add Export path= "$PATH:/usr/local/python3/bin"

Source/etc/profile after adding finished

* * Temporarily add environment variable to # export path= "$PATH:/usr/local/python3/bin" After terminal end environment variable takes effect

6. Open python3.6

[Email protected] ~]# Python3
Python 3.6.1 (default, May 19 2017, 04:11:00)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on Linux
Type "Help", "copyright", "credits" or "license" for more information.
>>>

7. Modify/usr/bin/python Link

# Cd/usr/bin

# mv Python Python.bak

# ln-s/usr/local/python3/bin/python3.6/usr/bin/python

# ln-s/usr/local/python3/bin/python3.6/usr/bin/python3

Modify to open Python3 directly with # python

CentOS 7 Installation python3.6.1

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.