python3.6和pip3安装

CenOS7

  1. 安装依赖环境
yum -y install openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc
  1. 编译安装python3
tar zxvf Python-3.5.3.tgz && cd Python-3.5.3
./configure
make && make install
  1. 安装完成默认有pip3
[root@ci-host Python-3.5.3]# whereis pip3
pip3: /usr/local/bin/pip3 /usr/local/bin/pip3.5

如果安装pyhon3提示pip is configured with locations that require TLS/SSL.... 是因为没有安装openssl-devel. 从第一步走一遍

CenOS安装python3.6 (tar.xz)

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz

tar -xvJf Python-3.6.5.tar.xz && cd Python-3.6.5

./configure prefix=/usr/local/python3
make && make install ln -s /usr/local/python3/bin/python3 /usr/bin/python3 ln -s /usr/local/python36/bin/pip3 /usr/bin/pip3 pip3 install -U pip

yum 安装

现在的epel.repo源中加入了Python36, 可以直接用yum安装

  1. 增加epel.repo
  2. yum install python36 python36-devel python-setuptools
  3. python36
  4. 安装pip3
$ sudo easy_install-3.6 pip -i https://pypi/douban.com/simple

$ whereis pip3
pip3: /usr/local/bin/pip3 /usr/local/bin/pip3.6
上一篇:关于iOS常用的26中公共方法,可copy的代码


下一篇:Effective Spark RDDs with Alluxio【转】