What Is a Package Manager?
Package Managers are tools that help you manage the dependencies for your project. A dependency is code that is required for your program to function properly. These often come in the form of packages.
Packages can also have their own dependencies. Managing all these dependencies can be hard because packages may require specific versions of their dependencies. It’s easy to break something by modifying dependencies manually.
00:00 As I alluded to earlier, software often relies on other software to function properly, because there’s no point in reinventing the wheel. This other software is called a dependency.
00:14 If it dependency changes, the software that uses it could potentially break. As you can probably imagine, dependencies can get messy fast. If we write software that depends on package A and package A depends on a specific version of package B and C, then you run into a scenario where you don’t want to update or delete anything in fear of breaking something else. This is where package managers come in.
00:45 A package manager is a tool that manages software and its dependencies. You can use them to install a package, and when you do so, the package manager will install exactly the correct version of each of that package’s dependencies.
01:03 It will also warn you about potential package incompatibilities. It can do this because the package manager keeps track of the dependencies for each package you have installed.
01:16
Basically, it’ll ensure that your project has all of the dependencies it needs to run properly. Package managers aren’t unique to Python. JavaScript uses the Node package manager, or npm
; .NET uses NuGet
; and Ruby uses gem
. Different operating systems can use package managers too, like Homebrew on Mac OS or the apt
package manager on Debian-based Linux distributions. In the next video, you’ll learn about pip
, Python’s default package manager.
Become a Member to join the conversation.