yum install python-virtualenv -y
pip3 install virtualenvwrapper
vim /root/.bashrc
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/python3/bin/virtualenvwrapper.sh
source ~/.bashrc
mkvirtualenv 虚拟环境名称
workon + 环境名称
deactivate
rmvirtualenv 虚拟环境名称
cpvirtualenv 虚拟环境名称
原文:https://www.cnblogs.com/weige007/p/12088305.html