Where are python modules stored?
1 answer
Let's say you want to know the location of a module xyz
. You do it on the interpreter
>>> import xyx
>>> xyz.__file__
You will get the location of the file pyc
where your module is imported from.
You can also just do
>>> xyz
to get the module name and module location.
To find out about all the possible places where modules are imported from, do this.
>>> import sys
>>> sys.path
This will give you a list of places where Python is looking for the module when you do import
.
Hope it helps.
+3
source to share