Easy way to manage python virtual environments.

Pre-requisites

  • Python 3.x or Python 2.7.x
  • pip (Python package installer)

1. Installation

  • Use pip to install pipenv
$ python -m pip install --upgrade pipenv$ pipenv --version  # Verify installation

2. Create a new pipenv project

  • There are multiple ways to create projects using pipenv. Examples:
# i. Creates new project using the latest version of python 2x or 3x$ pipenv --two
$ pipenv --three

# ii. Using a specific python version
$ pipenv --python 3.6.5

# iii. Specify a path where python is installed
$ pipenv --python /path/to/python

3. Manage project dependencies

  • The project dependencies are stored inside the Pipfile
  • Example:
$ pipenv install requests
  • It’s also possible to install dependencies that will be used in the development environment only.
  • Example:
$ pipenv install --dev pytest
Image for post
Image for post
Example Pipfile

References

Written by

Former Glorified Electrician(aka Electrical Engineer). Now a Software Developer working on complex Enterprise Software. Lets connect on twitter @NdamuleloNemakh

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store