From the course: Managing Python Projects

Package managers - Python Tutorial

From the course: Managing Python Projects

Start my 1-month free trial

Package managers

- [Instructor] A package manager will install third-party packages and their dependencies for you. Pip is the most widely used one and is a good choice. Pip is not the only package manager. There are others such as Poetry, Conda, Pipenv, and others. I'm going to talk about Pip, but the ideas here apply to other package managers as well. By default, Pip will install the latest version of a package. I highly recommend you specify which version of a package you want to install. It will save you from surprises in the future when someone accidentally introduces a bug or a change to a function parameters. You should also write your dependencies and their versions down and place this file in SuSE control so other team members and the operations team will be able to reproduce the same environment. Here's an example. This file is usually called requirements.txt. You can have comments like in line one and then in line three and four we specify the dependencies and we specify the version for every dependency. To install these requirements from Python -m pip install -r and our requirements file. Then the pip will install the dependencies and their dependencies. And now in our code we can use pandas for example. We put pandas as pd works.

Contents