使用pipenv(官方推荐)
pipenv只是一个工具,我们用这个工具来创建虚拟环境;我们用pipenv来创建一个虚拟环境,这个虚拟环境是和项目绑定的,也就是我们每创建一个项目就要创建一个虚拟环境
安装:
pip install pipenv
- 为项目安装独立的虚拟环境
# 进入项目相应的目录以后
pipenv install

image.png

image.png
启动pipenv
- 启动
# 在项目目录下执行
pip shell

image.png
- 退出
exit

image.png
- 安装包
pipenv install flask
- 卸载包
pipenv uninstall flask

image.png
- 查看包之间的依赖关系
pipenv graph

image.png
- 查看虚拟环境的路径

image.png
安装各种包,比如Flask
pipenv install flask