Python3安装

  

CentOS 6   Python3安装

源码安装:

1. Pytho3.5依赖软件包安装(如果不安装,python安装时候不会安装pip,通过源码安装pip也会报错)

yum -y install openssl-devel
yum -y install zlib-devel

2. Python3.5下载安装并解压

https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz
tar -xzf Python-3.6.1.tar.xz

3.编译安装

cd Python-3.6.1
./configure
make && make install

升级pip3

pip3 install --upgrade pip

错误:

1. pip 使用时候出现错误:

  ImportError: cannot import name HTTPSHandler

  安装时候未安装openssl-devel,需要安装openssl-devl

      然后重新编译安装python

  

yum安装:

1. epel安装(默认Centos6 yum源不包含python3)

yum -y install epel-release

2.依赖包安装()

yum -y install openssl-devel
yum -y install zlib-devel

3. Python3安装

yum -y install python34
原文地址:https://www.cnblogs.com/onlybobby/p/6898397.html