Installing Python3.6 under CentOS

Source: Internet
Author: User
Tags md5

First, install the python3.6.1
1. Installation Dependent environment
#yum Install Readline-devel # #必须安装否则会出现python3编译器中不能使用退格键和方向键
2. Download and unzip the installation package
[Email protected] ~]# wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz # #下载安装包
[Email protected] ~]# tar zvxf python-3.6.1.tgz # #解压安装包
3. Compile and install
[Email protected] ~]# CD Python-3.6.1 # #进入安装包
[Email protected] python-3.6.1]# Mkdir/usr/local/python3 # #创建安装目录
[Email protected] python-3.6.1]#/configure--prefix=/usr/local/python3 # #编译
[[email protected] python-3.6.1]# make && make install # #安装
4. Create a soft connection
[Email protected] python-3.6.1]# Mv/usr/bin/python/usr/bin/python_bak # #备份原软连接
[Email protected] python-3.6.1]# ln-s/usr/local/python3/bin/python3/usr/bin/python # #chua创建新的软链接使程序运行时不显示版本号
5. Test software can run normally
[[email protected] python-3.6.1]# Python
Python 3.6.1 (Default, APR 21 2018, 16:42:07)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on Linux
Type "Help", "copyright", "credits" or "license" for more information.

6. Add/usr/local/python3/bin to environment variable
[[email protected] python-3.6.1]# vim ~/.bash_profile
path= $PATH: $ Home/bin:/usr/local/python3/bin
[[email protected] python-3.6.1]# source ~/.bash_profile # #使环境变量生效
[[ Email protected] python-3.6.1]# python3-v # #测试python3正常
Python 3.6.1
[[email protected] python-3.6.1]# pip3-v # #测试pip3正常
Pip 9.0.1 from/usr/local/python3/lib/python3.6/site-packages (Python 3.6)
7, Modify Yum to point to Python old version
[[email protected] pip-8.0.2]# Vi/usr/bin/yum
#!/usr/bin/python2.6

Second, the installation of Pip and Setuptools
1. Pre-installation Setuptools required before PIP installation
[Email protected] ~]# wget--no-check-certificate https://pypi.python.org/packages/source/s/setuptools/ Setuptools-19.6.tar.gz#md5=c607dd118eae682c44ed146367a17e26
[Email protected] ~]# tar zxvf setuptools-19.6.tar.gz
[Email protected] ~]# CD setuptools-19.6
[Email protected] ~]# Python3 setup.py Build
[Email protected] ~]# python3 setup.py Install
2. Install Pip
[Email protected] ~]# wget--no-check-certificate https://pypi.python.org/packages/source/p/pip/pip-8.0.2.tar.gz# Md5=3a73c4188f8dbad6a1e6f6d44d117eeb
[Email protected] ~]# tar zvxf pip-8.0.2.tar.gz
[Email protected] ~]# CD pip-8.0.2
[Email protected] pip-8.0.2]# Python3 setup.py Build
[Email protected] pip-8.0.2]# python3 setup.py Install

Installing Python3.6 under CentOS

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.