Skip to content

Latest commit

 

History

History
79 lines (52 loc) · 855 Bytes

pipenv.md

File metadata and controls

79 lines (52 loc) · 855 Bytes

1 安装pipenv

pip3 install pipenv

2 创建虚拟环境

# mkdir project
# cd project
# pipenv install // 初始化

3 安装依赖包

# pipenv install requests

4 查看安装包及依赖关系

# pipenv graph

只在开发环境中安装

# pipenv install --dev requests --three
--three / --two  Use Python 3/2 when creating virtualenv

5 兼容requirements.txt文件

# pipenv lock -r --dev > requirements.txt
# pipenv install -r requirements.txt

6 运行Python代码

method 1

# pipenv run python xxx.py

method 2

# pipenv shell
# python3 xxx.py

7 删除依赖包

# pipenv uninstall requests

8 删除虚拟环境

# pipenv --rm

9 设置pip源

编辑Pipfile, 修改url的地址