problem with import path on a python C extension

Carsten Haese carsten.haese at
Mon Feb 9 16:02:22 EST 2009

fredbasset1000 at wrote:
> [...]
> So my question is why can't Python locate the new extension module
> when I try to import it with "import project.drivers.dio.diomodule"?
This import statement binds the module to the name
"project.drivers.dio.diomodule". It does not bind anything to the name
"diomodule", which is the name you want to use to refer to the module.

To bind the "diomodule" name to this module, you can do one of two things:

   from project.drivers.dio import diomodule

   import project.drivers.dio.diomodule
   diomodule = project.drivers.dio.diomodule

Hope this helps,

Carsten Haese

More information about the Python-list mailing list