Where do modules come from | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite

Where do modules come from

This question is about the mechanics of Python. If I import a function, where is it importing from? Is there a master user library that python coding is connected to? Do you program the python installed on your computer to look somewhere where you download modules and save modules? To me this is a black box of mystery and I would love some help understanding. EDIT: I also wonder: if another user runs your code, how do they run it if they don't have the right modules installed themselves? How is this packaged?

29th Dec 2017, 11:45 PM
Theresa - avatar
1 Réponse
+ 3
some of the modules are part of the core python packaging. Other packages will require a download of the required modules for it to work. (such as PIP requests). Usually, you can package Python applications as well as their required modules when you deploy them (search for Python Freeze for more information) :)
29th Dec 2017, 11:53 PM
Frédéric Charette
Frédéric Charette - avatar