I've created a little python application that uses sqlite3. I need this to run a variety of systems, so I've got to have compatibility with Python 2.3. From the looks of it, I need to have pysqlite2 compiled for 32-bit and 64-bit as well as python 2.3 and 2.4, so I'll need a total of 4 builds.
I've already compiled it for each of those scenarios and I've placed it in my applications dir. It appears that dashes aren't allowed in the import statement for python, so I had to get a little creative with my folder naming.
Code:
program.py
modules/__init__.py
modules/pysqlite2i686p24/__init__.py
modules/pysqlite2i686p24/dbapi2.py
modules/pysqlite2i686p24/dump.py
modules/pysqlite2i686p24/_sqlite.so
In my program.py, I have
Code:
import modules.pysqlite2i686p24.dbapi2 as sqlite3
The issue appears to be that in dbapi2.py it has
Code:
from pysqlite2._sqlite import *
so every time I run I get the error
Code:
ImportError: No module named pysqlite2._sqlite
I can fix this as long as the folder containing pysqlite2 is named pysqlite2, but thats going to create (IMO) somewhat of an overengineered tree of directories. Is there an easier way to resolve this issue?
Bookmarks