Skip to content

Instantly share code, notes, and snippets.

@shivampip
Forked from bradtraversy/pipenv_cheat_sheet.md
Last active November 11, 2019 18:26
Show Gist options
  • Save shivampip/112d5e4f0f485416f395176e5c86dcd1 to your computer and use it in GitHub Desktop.
Save shivampip/112d5e4f0f485416f395176e5c86dcd1 to your computer and use it in GitHub Desktop.
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell

Check version of Python

python --version

Check path

python
>>> import sys
>>> sys.executable
quit()

Install a package

pipenv install camelcase

Check local packages

pipenv lock -r

Uninstall a package

pipenv uninstall camelcase

Install a dev package

pipenv install nose --dev

Install from requirements.txt

pipenv install -r ./requirements.txt

Check security vulnerabilities

pipenv check

Check dependency graph

pipenv graph

Set lockfile - before deployment

pipenv lock

Ignore pipfile (while installing on server)

pipenv install --ignore-pipfile

Note

  • pipfile contains * for latest packages.
  • using pipenv lock , we lock current versions in piplock file
  • and in production, we install from this lock file using pipenv install --ignore-pipfile
  • it installs (samajh gye na) badiya pkg.

Exiting the virtualenv

exit

Run with pipenv

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