Skip to content

Instantly share code, notes, and snippets.

@MohamedKari
Created March 12, 2020 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MohamedKari/72927eb11719edb286e9dea7e1f3d645 to your computer and use it in GitHub Desktop.
Save MohamedKari/72927eb11719edb286e9dea7e1f3d645 to your computer and use it in GitHub Desktop.
Pipenv Usage

Building a pipenv

Alternative 1: Incremental

Initialize

First, create a new and empty pipenv. If there is no Pipfile, the following command will create an empty one:

pipenv install

This will install a virtual env at a shared location on the machine, e. g. /Users/mo/.local/share/virtualenvs.

Next, install relvant packages either using CLI installs or by editing the Pipfile and doing CLI updates.

Alternative 1: CLI installs:

pipenv install flask

This automatically updates the Pipfile so that the virtual env is in sync with the Pipfile and so that installs can be reproduced on other machines.

Alternative 2: Pipfile edits and CLI updates:

Insert flask = "*" into the packages section of

pipenv update

This will also sync the Pipfile and the virtual env.

Alternative 2: Big Bang

Put your Pipfile into the working directory and run

pipenv install

Activate env

Execute

pipenv shell

from the working dir to activate the environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment