pysqlite and p3d

Hello,

i’m trying to distribute a panda3d application over the web. when i create the p3d file everything goes fine except that i don’t know how to add pysqlite when i create the p3d file.

i use:

packp3d -S mycert.pem -o demo.p3d -d src

when i run the p3d file this is the output i get

    from pysqlite2 import dbapi2 as sqlite
ImportError: No module named pysqlite2
:task(error): Exception occurred in PythonTask Messenger-default
Traceback (most recent call last):
  File "C:\panda3d-1.7.0\built_cmu\direct\p3d\AppRunner.py", line 411, in run
  File "C:\panda3d-1.7.0\built_cmu\direct\task\Task.py", line 496, in run
  File "C:\panda3d-1.7.0\built_cmu\direct\task\Task.py", line 454, in step
  File "C:\panda3d-1.7.0\built_cmu\direct\showbase\Messenger.py", line 352, in _
_taskChainDispatch
  File "C:\panda3d-1.7.0\built_cmu\direct\showbase\Messenger.py", line 410, in _
_dispatch
  File "C:\panda3d-1.7.0\built_cmu\direct\p3d\AppRunner.py", line 493, in __star
tIfReady
  File "VFSImporter", line 153, in load_module
  File "D:\DEV\ArcimboldoWeb\src\main.py", line 59, in <module>
    from db import db
  File "VFSImporter", line 153, in load_module
  File "D:\DEV\ArcimboldoWeb\src\db.py", line 1, in <module>
    from pysqlite2 import dbapi2 as sqlite
ImportError: No module named pysqlite2
Failure on startup.

Hmm, I don’t believe pysqlite is one of the packages that rdb built by default. This means that if you really wanted to use it, you would have to copy it into your p3d space, including any platform-specific pyd’s or so’s, and include it as part of your own project. This would make your p3d file platform-specific as well.

On the other hand, we do provide the ‘sqlite’ module instead, which appears to be a different module with a similar goal. Is it an option for you to use sqlite instead of pysqlite?

David

thank’s for the answer, i’m going to try sqlite instead of pysqlite :slight_smile:

You can include that package by specifying “-r sqlite” on the command-line.