Pipenv Tutorial

Like npm, pipenv is the officially recommended Python packaging tool from Python.org.

Installation

For MacOS

$ brew install pipenv
$ echo 'export PIPENV_VENV_IN_PROJECT=1' >> ~/.zshrc
# or ~/.basrc depends on your shell

For Ubuntu

$ sudo apt install pipenv
$ echo 'export PIPENV_VENV_IN_PROJECT=1' >> ~/.zshrc

Quick guide

Create virtual environment

# for python3
$ pipenv --three
# for python2
$ pipenv --two

Enter virtual environment

$ pipenv shell

It’s the same as ‘source venv/bin/active’

Install packages

$ pipenv install flask numpy
$ pipenv install pytest --dev

Check out packge

$ pipenv graph

It’s like ‘pip list’ but more friendly

Reference

[1] Pipenv: Python Dev Workflow for Humans