Loading video player…

Working With Pipenv (Overview)

Managing multiple Python projects with their own third-party packages can get complicated. It is best practice to use a virtual environment to sandbox the requirements for each of your projects. Enter pipenv, the official recommended package management tool for Python. It handles both installation and virtual environments to help you manage your Python dependencies.

In this course, you’ll learn about:

  • How to use pip to install a package
  • Where Python puts packages by default
  • How to use pipenv to create virtual environments and install packages
  • How pipenv handles package conflicts

Sample Code (.zip)

33.0 KB

Course Slides (.pdf)

967.4 KB

00:00 Welcome to Pipenv: The Python Packaging Tool. My name is Christopher, and I will be your guide.

00:06 This course is all about the Python package management tool pipenv. You will learn about where Python packages get installed, how to use pip, and how to use pipenv to manage packages and virtual environments. Throughout this course, I’ve used a clean installation of Python 3.10.

00:25 I did this so you can see what changes when you add packages. Although I’m using 3.10, there isn’t anything version specific in here, so as long as you’re using at least Python 3.6, which is the minimum supported version of pipenv, you should be good.

00:40 One of the mantras of Python is “batteries included.” The language ships with a very large library, but it doesn’t cover everything. Fortunately, there is also a vibrant community of contributors out there creating lots of third-party libraries.

00:54 Python ships with a package installation tool called pip. It does exactly what you’d expect. It installs packages. It does have some consequences, though.

01:04 Everything you install gets put in a single place with the interpreter. This can be problematic if you need to manage multiple versions of packages for different projects you’re working on.

01:13 This is why virtual environments are considered best practice. Typically, each project should get its own virtual environment, sandboxing the libraries associated with it.

01:24 The tool currently recommended for package management is pipenv. It combines pip and virtualenv in one tool and helps you manage your packages.

01:34 Next up, I’ll show you how pip works and where it installs your packages.

Become a Member to join the conversation.