centos7快速安装python3


拿到手一台云服务器安装centos7后,默认python版本为python2.7,pip命令不存在,如何快速安装pip及python3

python2.7安装pip

为python2.7安装pip工具。
centos7为python2.7安装pip
先安装setuptools后安装pip 或 yum -y install python-pip
sudo yum install python-setuptools
sudo easy_install pip

安装python3及pip3

yum search python36
配置好Python3.6和pip3
安装EPEL和IUS软件源
yum install epel-release -y
yum install https://centos7.iuscommunity.org/ius-release.rpm -y
安装Python3.6
yum install python36u -y
yum install python36u-devel.x86_64 -y
创建python3连接符
ln -s /bin/python3.6 /bin/python3
安装pip3
yum install python36u-pip -y
创建pip3链接符
ln -s /bin/pip3.6 /bin/pip3

多版本python共存

安装pyenv操作pyenv