Here’s the differnce between a module, a package and library in Python.
- Module
- A single file that contain Python codes, functions, classes, etc.
import my_module
- Package
- A collection of
modules
stored in a directory. - Every
package
contains a__init__.py
file. - Library
- Refers to a collection of
modules
andpackages
.