Pipenv Quick Start
pipenv, authored by the creator of requests, wraps virtualenv, pip, and Pipfile management into a single tool for project-specific environments.
Install
pip install pipenv
Create an environment
Run inside your project directory:
pipenv --two
Use --two for Python 2 or --three for Python 3. On Windows you may need to point at the interpreter explicitly:
pipenv --python "C:\Python27\python.exe"
Install dependencies
pipenv install
This reads Pipfile / Pipfile.lock. If neither exists, pipenv converts requirements.txt automatically. Install a package explicitly:
pipenv install six
After adding packages, refresh the lockfile:
pipenv lock
Activate the env
pipenv shell
Notes
- You can still run
pipinside the environment, but it will not updatePipfile. - Pipenv cannot magically fix packages that fail to install under
virtualenv. - Pipenv stores environments in a central directory. When you run
pipenv shellit looks for a matching folder based on the current path; if none exists it assumes the project has no environment.
Reference: