Module name does not match file name

Chris Angelico rosuav at
Mon Jul 7 10:04:36 CEST 2014

On Mon, Jul 7, 2014 at 5:57 PM, Steven D'Aprano <steve at> wrote:
> Can anyone explain how "import pg" can end up coming from

First guess: There's a "" somewhere that imports the so, then
replaces itself in sys.modules.

import sys

>>> import importme
>>> importme
<module 'sys' (built-in)>

Unfortunately, that doesn't help much with actually finding the source
code that's doing this.


More information about the Python-list mailing list