目的
- 为了更方便管理库的版本
虚拟环境
库:pipenv
一、安装
pip install pipenv
二、使用
- 在你的项目中,使用
pipenv install安装 - 使用
pipenv shell激活虚拟环境 - 不激活的话,使用
pipenv run运行
多出来两个文件: Pipfile, Pipfile.lock
- 使用
pipenv install xxx安装指定的库
三、常用命令
| 语法 | 功能 |
|---|---|
| pipenv check | 检查库的安全性 |
| piping install | 你刚看到的库的安装 |
| pipenv graph | 查看库的依赖 |
| pipenv uninstall xxx | 卸载库 |
| pipenv update | 更新 |
| pipenv open xxx | 查看具体的库 |
| pipenv shell | 进入虚拟环境 |
| exit | 退出虚拟环境 |
| pipenv sync | 安装Pipfile.lock中的库 |
| pipenv | 查看命令和参数使用解释 |
总结
本次学习了虚拟环境的搭建和简单操作。
原创
python打造个人管理系统00-虚拟环境搭建
本文采用 CC BY-NC-SA 4.0 许可协议,转载请注明出处。
评论交流
欢迎留下你的想法