python3安装虚拟环境
#1.安装虚拟环境 pip3 install virtualenv #2.创建虚拟环境 python3 -m venv venv #或者 python3 -m venv . #3.激活虚拟环境 在开始工作前,先要激活相应的虚拟环境: . venv/bin/activate 在 Windows 下: venvScriptsactivate #激活后,你的终端提示符会显示虚拟环境的名称。
退出虚拟环境
(venv) E:w>deactivate
使用freeze 给所有模块搬家
# 导出安装模块的文档 pip freeze > my_freeze.txt # 或者指定地址 pip freeze > e:my_freeze.txt # 在另一个环境下,安装该文档里的模块 pip install -r my_freeze.txt