Pipenv Tutorial

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


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


[1] Pipenv: Python Dev Workflow for Humans

本文作者: Vincent0700
本文地址: https://vincentstudio.info/2019/04/13/025_Pipenv_Tutorial/
版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!