MemotivaModules, packages, and imports

How does Python find modules to import?

Modules, packages, and imports

Audio flashcard · 0:15

Nortren·

How does Python find modules to import?

0:15

Python searches the directories listed in sys.path. The first entry is typically the directory of the script being run, followed by the standard library, site-packages, and any directories from the PYTHONPATH environment variable. You can inspect and modify sys.path at runtime.
docs.python.org