sudo apt install python3-pip -i https://pypi.douban.com/simple/
pip3 install virtualenv -i https://pypi.douban.com/simple/
pip3 install virtualenvwrapper -i https://pypi.douban.com/simple/
mkdir $HOME/.virtualenvs
which python3 # /usr/bin/python3
vim ~/.bashrc
# 在最后面添加以下代码 export WORKON_HOME=$HOME/.virtualenvs #指定virtualenvwrapper环境的目录(which python3 获取的python位置) export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 #指定virtualenvwrapper通过哪个python版本来创建虚拟环境 source ~/.local/bin/virtualenvwrapper.sh
source ~/.bashrc
Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module named 'virtualenvwrapper')
virtualenvwrapper.sh: There was a problem running the initialization hooks.
报错解决https://blog.csdn.net/qq_52385631/article/details/123591311
workon
mkvirtualenv 文件夹名(起的虚拟环境名称) # 案例 mkvirtualenv t1
mkvirtualenv -p 基于哪个虚拟环境 新的虚拟环境名称 # 案例 mkvirtualenv -p python3.6 t3_3.6
deactivate
rmvirtualenv 虚拟环境名