pipenv 包含了Pipfile、pip、click、requests和virtualenv。Pipfile是社区拟定的依赖管理文件,用于替代过于简陋的 requirements.txt 文件。
注意:一下命令在项目根目录执行
- 安装
- pip install pipenv
- 查看版本
- pipenv --version
- 创建
- pipenv --python 3.7
- 激活虚拟环境
- pipenv shell
- 退出
- exit
- 安装开发扩展
- pipenv install --dev django
- 安装生产环境
- pipenv install
- 安装开发环境
- pipenv install --dev
- 卸载包
- pipenv uninstall [package]
- 查看创建虚拟机所在目录
- pipenv --venv全局切换版本pyenv global 3.6.4当前目录切换版本pyenv local 3.6.4pipenv --three # 初始化一个python3虚拟环境,如果想初始化pyhton2的虚拟环境,则使用pipenv --twopipenv --python 2.7.14删除环境(在pipfile所在目录执行)pipenv --rm卸载所有
- pipenv uninstall --all # 卸载全部包
-
国内源
- 阿里云:http://mirrors.aliyun.com/pypi/simple/
- 豆瓣:http://pypi.douban.com/simple/
- 清华大学:https://pypi.tuna.tsinghua.edu.cn/simple/
- 中国科学技术大学:https://pypi.mirrors.ustc.edu.cn/simple/
-
在根目录下pipenv --version找不到命令
-bash: pipenv: command not found
·报错:
ModuleNotFoundError: No module named '_ctypes' ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
- pip3 config set global.index-url https://mirrors.aliyun.com/pypi/simple/
-
- yum install libffi-devel -y
-
- ln -s /usr/local/python3/bin/pipenv /usr/bin/pipenv3
-
- pipenv, version 2020.6.2
-