python3.6 environment on the CentOS cloud service shelves

Source: Internet
Author: User

The management of the cloud service is an SSH tool. I had to mobaxterm for a while, and I was amazed at how Putty I felt canary for years. The free version has already been used, it is convenient for the United States to use to know the good:

This is where you record the setup steps:

1, this server OS is CentOS 7.3, the python2.7 version of the default line. So the first installation python3.6 replaced python2.7 as an implicit python environment.

PYTHON-V//Can see the Python version now
Which Python//can see the executable file location of Python now

Install Python3 and a bunch of software packages first

sudoyuminstall python36
Sudu Yum Install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

You need to modify the system to recognize the Python path after you have prepared it:

MV /usr/bin/python/usr/bin/python_old

Create software to perform a catalogue/usr/bin

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

This time python-v should be the new version. You can see the 2 version with Python2-v.

But it's not over, Yum uses py2, and after that it's a bad thing for Yum to get rid of Yum's configuration.

vim /usr/bin/Yum

Vim/usr/libexec/urlgrabber-ext-down

Put #! /usr/bin/python modified to #! /usr/bin/python2

2, next to modify the configuration of the PIP, now the PY3 environment is not installed in the PIP, so you have to download one.

Curl https://bootstrap.pypa.io/get-pip.py-o get-pip.py

Download it.

Python get-pip.py

And then go into the/usr/bin. Change PIP configuration

Vim/usr/bin/pip

Change the first line to #! /usr/bin/python. Basically, Pip is py3 down the line.

3, and then swap out Pip's default to the PIP source in the country, or it's too slow.

/etc/pip.conf

~/.pip/pip.conf

~/.config/pip/pip.conf

These files, if not created. It is good to write the source of Douban in the document.

[global]trusted-host=pypi.douban.comindex-url=http://Pypi.douban.com/simple 

python3.6 environment on the CentOS cloud service shelves

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.