安装 venv 模块
python -m venv myenv
激活虚拟环境
windows
myenv\Scripts\activatemacOS 和 Linux
source myenv/bin/activate
安装依赖
pip install requests
导出依赖
pip freeze > requirements.txt
恢复依赖
pip install -r requirements.txt
退出虚拟环境
deactivate
python -m venv myenv
windows
myenv\Scripts\activate
macOS 和 Linux
source myenv/bin/activate
pip install requests
pip freeze > requirements.txt
pip install -r requirements.txt
deactivate