yum不支持直接安装Python3
安装步骤:
sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm
添加Python3仓库sudo yum update
更新软件列表sudo yum -y install python36u python36u-pip
安装Python3与pip3python3.6 --version
pip3.6 --version
查看是否安装成功python3.6 -m venv ~/venv
创建虚环境source ~/venv/bin/activate
激活虚环境deactivate
退出虚环境CentOS默认不带which
yum whatprovides *bin/which
查询哪个包提供which命令。可以看到是which
包yum install which
安装which
包