Skip to content

Instantly share code, notes, and snippets.

@molcay
Created May 24, 2019 12:08
Show Gist options
  • Save molcay/5c0565b11c489dd8522e89faeeaa95c7 to your computer and use it in GitHub Desktop.
Save molcay/5c0565b11c489dd8522e89faeeaa95c7 to your computer and use it in GitHub Desktop.
Notes about Pipenv

Pipenv Notes

  • Install pipenv:
pip install pipenv
  • Create or activate virtualenvironment:
pipenv shell
  • Install dependency:
pipenv install flask=0.12.1
# or
pipenv install numpy # without exact version
# or
pipenv install -e git+https://github.com/requests/requests.git#egg=requests # From source
  • Install dependency as dev dependency:
pipenv install pytest --dev
  • Create or update Pipfile.lock file:
pipenv lock
  • For production environment, install dependecies from file(Pipfile and Pipfile.lock):
pipenv install --ignore-pipfile
  • For install dependecies for development environment from file(Pipfile):
pipenv install --dev
  • To see dependency graph:
pipenv graph
# or
pipenv graph --reverse
  • Open a package in editor:
pipenv open flask
  • You can run a command in the virtual environment without launching a shell:
pipenv run <insert command here>
  • Delete packages:
pipenv uninstall numpy  # Remove a package
# or
pipenv uninstall --all  # Reove all dependencies
# or
pipenv uninstall --all-dev  # Remove all development dependencies

Pipenv supports the automatic loading of environmental variables when a .env file exists in the top-level directory.

  • Locate virtual environment:
pipenv --venv
  • Locate project home directory:
pipenv --where
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment