problem with import path on a python C extension
carsten.haese at gmail.com
Mon Feb 9 16:02:22 EST 2009
fredbasset1000 at gmail.com 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
diomodule = project.drivers.dio.diomodule
Hope this helps,
More information about the Python-list