One of the questions that regularly pops up is why the
import statement isn't working as expected. The problem here is that you have to know what to expect. Blender has augmented the standard import behavior of Python to make it possible to import from the text files residing within a
.blend file. This is a great boon because it allows you to modularize your code without the need to distribute separate files. However, the behavior of the part that imports these internal files should be absolutely clear to spare you nasty surprises but it is, at the moment, not very well-documented.
This is what happens when an
import statement such as
import foo is executed:
foo.pyexists in any of the directories ...