centos6.9 Installing python3.6.0 and modules

Source: Internet
Author: User

1. Install dependent packages

Yum-y install wget zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel DB4 -devel libpcap-devel xz-devel gcc gcc++



2. Download Python package, unzip, compile and install

wget HTTPS://WWW.PYTHON.ORG/FTP/PYTHON/3.6.0/PYTHON-3.6.0.TGZTAR-XZVF./python-3.6.0.tgz-c/usr/local/src/cd/usr/ Local/src/python-3.6.0/./configure--prefix=/usr/local/pythonmakemake Install



3. Change the environment variable and make it effective, verify

Vim ~/.bash_profilepath= $PATH: $HOME/bin# change to: path= $PATH: $HOME/bin:/usr/local/python/binsource ~/.bash_ Profilepython3-v



4. Set the default Python version

Mv/usr/bin/python/usr/bin/python2.6ln-s/usr/local/python/bin/python3.6/usr/bin/python




5. Check Python version

Python-vpython 3.6.0python2.6-vpython 2.6.6



6, change Yum program, yum program to use Python 2.X

Vi/usr/bin/yum changed #!/usr/bin/python to #!/usr/bin/python2.6



7. PIP Installation Module

PIP3 Install Requests


centos6.9 installing python3.6.0 and modules

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.