MAC OS安装virtualenv

pip3 install --upgrade pip  ## 升级pip
pip3 install virtualenv
pip3 install virtualenvwrapper
which virtualenvwrapper.sh ## 查找virtualenvwrapper.sh位置,下面需要写入到.bash_profile文件中
which python3  ## ## 查找python3位置,下面需要写入到.bash_profile文件中
vi ~/.bash_profile  ## 将下面三行写入到.bash_profile中,第二行和第三行的路径是通过前面两个命令找到的
export WORKON_HOME='~/.virtualenvs'
export VIRTUALENVWRAPPER_PYTHON='/Library/Frameworks/Python.framework/Versions/3.7/bin/python3'
source /Library/Frameworks/Python.framework/Versions/3.7/bin/virtualenvwrapper.sh
## 一些常用的命令
workon   会列出所有的虚拟环境
workon  [name]  会进入指定的虚拟环境
deactivate   退出当前的虚拟环境
mkvirtualenv  [name] 创建虚拟环境
rmvirtualenv  [name] 删除虚拟环境