sudo yum update
sudo yum install centos-release-scl
sudo yum install rh-python36
scl enable rh-python36 bash
sudo yum groupinstall "Development Tools"
mkdir ~/python_project cd ~ scl enable rh-python36 bash python –m venv python_project
source ~/python_project/bin/activate
cd ~/python_project/bin/ source activate
deactivate
在~/.bashrc最下面一行添加html
alias changepy3='source ~/python_project/bin/activate'
source ~/.bashrc
changepy3
文章參考 How To Install Latest Version Of Python 3 On CentOS 7 python虛擬環境使用python