centos6.8 安装 python3.6 and pip3

准备安装环境

yum groupinstall 'Development Tools'
yum install zlib-devel bzip2-devel  openssl-devel ncurses-devel

下载并解压python3.6.1版本

wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
tar zxvf  Python-3.6.1.tgz

编译安装

cd Python-3.6.1
./configure --prefix=/usr/local/python3
make && make install

设置环境变量

echo 'export PATH=$PATH:/usr/local/python3/bin' >> ~/.bashrc

重启shell

exec $SHELL

现在就可以使用python3和pip3了

python3
pip3

更换pip为国内源, 安装速度大大提升!

http://www.jianshu.com/p/27cbea705847

你可能感兴趣的:(centos6.8 安装 python3.6 and pip3)