finding a module

Giorgi Lekishvili gleki at
Fri Jan 25 18:54:54 EST 2002

Kevin Dahlhausen wrote:

> I'm having a little trouble finding a c extension.  Here's the
> situation:
> I have a web host that allows python cgi.  I've also written a wrapper
> for a library.  The wrapper is a subdirectory with an
> file.  In the same subdirectory is a swig-generated c wrapper (
> ) that is imported by one of the files imported by
>  The main web application sits in the directory above the
> module directory:
>   .....\webapp\main.cgi               (imports sqlitedb)
>   .....\webapp\sqlitedb\   (imports wrapper)
>   .....\webapp\sqlitedb\    (imports sqlitec)
>   .....\webapp\sqlitedb\
> The code on 'main.cgi' contains an import: 'import sqlitedb'.
> Python finds the sqlitedb python files, but can not find
> They are runing Python 1.6.

The SWIG generated module MUST be called Note the
Try this..

> How can I allow Python to see the loadable module?   It is
> possible/common for the web providers to disallow import of native
> code modules?
> I've tried adding the following to main.cgi:
>   import sys
>   sys.path.append(".")
>   sys.path.append("./sqlitedb")
>   import sqlitedb
> but that did did not fix anything.
> Any ideas?
> If this works, we would be very close to having thread-safe
> python-based web sites w/an sql database but without an sql server.
> (Sqlite is a file-based database similar to gadfly).

More information about the Python-list mailing list