finding a module

Kevin Dahlhausen kdahlhaus at yahoo.com
Fri Feb 1 12:57:29 EST 2002


Thanks, I tried it last night but to no avail.  I am beginning to
think they have disabled dynamic loading of user modules or
something....

Giorgi Lekishvili <gleki at gol.ge> wrote in message news:<3C51F04E.82082244 at gol.ge>...
> 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 __init__.py
> > file.  In the same subdirectory is a swig-generated c wrapper (
> > sqlitec.so ) that is imported by one of the files imported by
> > __init__.py.  The main web application sits in the directory above the
> > module directory:
> >
> >   .....\webapp\main.cgi               (imports sqlitedb)
> >   .....\webapp\sqlitedb\__init__.py   (imports wrapper)
> >   .....\webapp\sqlitedb\wrapper.py    (imports sqlitec)
> >   .....\webapp\sqlitedb\sqlitec.so
> >
> > The code on 'main.cgi' contains an import: 'import sqlitedb'.
> > Python finds the sqlitedb python files, but can not find sqlitec.so.
> > They are runing Python 1.6.
> 
> The SWIG generated module MUST be called sqlitemodule.so... Note the
> difference.
> Try this..
> GRTZ,
> Giorgi
> 
> >
> >
> > 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