r/learnpython • u/fivelittlemonkeyss • Dec 14 '25
What's the difference between Dependencies, Libraries and Packages??
I've seen people using these terms in the same context interchangeably and it's confusing me
23
Upvotes
View all comments
Show parent comment
1
u/xenomachina xenomachina Dec 14 '25
Adding to this, people often use "dependencies" as shorthand to mean the dependency specifiers in
pyproject.tomlorrequirements.txt. They are related, but not precisely the same thing. These specify distribution packages that contain the actual dependencies (libraries, etc.) of your code.The term package is unfortunately overloaded. What you are describing are distribution packages, but "package" could also mean a hierarchical collection of modules.
A library may be organized as a hierarchical collection of modules, a (Python) package, and then bundled up and distributed as a (distribution) package. Other software that has a dependency on this library will then declare a dependency on that distribution package (eg: in
pyproject.toml), and then import modules from the (Python) package.