pipenv 的 使用和安装

[toc]


安装

使用 brew 安装


$ sudo chown -R $(whoami) /usr/local/share/aclocal /usr/local/share/info
$ brew install pyenv

pip 可能会安装失败

$ pip install pyenv
Collecting pyenv
  Could not find a version that satisfies the requirement pyenv (from versions: )
No matching distribution found for pyenv

使用

1、创建文件夹

2、进入文件夹,基于 python 创建 env 环境

$ pipenv --python /usr/bin/python

3、安装库

$ pipenv install Django==1.11.5
$ pipenv install mysql-python

安装库的时候,如果出现些莫名其妙的问题,可以去文件夹下面查看 pipfile 文件


4、pycharm 选中环境
Project - project interpreter
… /.env/bin/python

猜你喜欢

转载自blog.51cto.com/14129329/2331927