- 每个项目都需要建一个在项目目录下的虚拟环境
- 用来部署方便高效
操作步骤
进入项目根目录
- 安装当前python环境
pipenv install
- 指定环境
pipenv --python 3.6
- 激活虚拟环境
pipenv shell
- 安装包
pipenv install django==1.11
补充信息:由于pipenv默认下载源在国外服务器,因为种种原因导致是不是下载慢 超时等等,最好设置国内镜像
打开虚拟环境的python路径 ,进入
vim .project/Pipfile
修改url后的网址即可
清华 https://pypi.tuna.tsinghua.edu.cn/simple
阿里 http://mirrors.aliyun.com/pypi/simple/

网友评论