Newbie terminology question: Difference between module, package, and library?


As a programming newbie taking the “Complete Python Mastery” course, mosh introduced us to the idea of a module (which he defined as a python file), and a package (which he described as a folder of modules). However, online and in the python course too, I am seeing that the word library gets thrown around a lot too.

As such, I wanted to ask what is the difference between a module, package, and a library. Are they the same?

Thanks a lot!

The description you mentioned for module and package is correct. Sometimes people use package and library interchangeably but realistically a library is basically a collection of related modules and/or packages. I.e. Matplotlib is a python library that contains packages and modules for data visualization.

1 Like