problem with import path on a python C extension

2009-02-09 Thread fredbasset1000
Hi All, I've written a simple Python extension module in C, but Python is having problems trying to locate it when I import it into an existing Python file. In my example, I wrote a C extension called diomodule which exists in the directory : /root/project/drivers/dio/ diomodule.c. It has

Re: problem with import path on a python C extension

2009-02-09 Thread Carsten Haese
fredbasset1...@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

Re: problem with import path on a python C extension

2009-02-09 Thread Carsten Haese
fredbasset1...@gmail.com wrote: I can only get it to work if I copy the .so file to the directory where daemon.py is and change the import to import diomodule. And to supplement my previous reply, another solution is to make sure that /root/project/drivers/dio is in your PYTHONPATH. Then you