It automatically creates and manages a virtualenv for your projects, as well as adds/removes packages from your Pipfile as you install/uninstall packages. It also generates the ever-important Pipfile.lock, which is used to produce deterministic builds.

You can create .python-version file inside your project with a version number, like 3.7.1. Specified Python version will be activated automatically when you enter to the project directory. It will also automatically install the specified version if pyenv is installed.

If you want to install package, use pipenv instead of pip.

pipenv install django

It will add a package to Pipfile file and Pipfile.lock. If you want to install all packages from Pipfile, use pipenv install command.

If you want to install a package required only for development, add --dev flag.

pipenv install pytest --dev

pipenv can also load environment variables from .env files.

Create .env file with your variables.

Run pipenv shell.

You can scan your dependency graph for known security vulnerabilities: