Import sqlite issue in Slicelet, Slicer 4.8.1


(Ehouarn) #1

Hi Slicer community,

I am pretty new in Slicer extensions development,
I try to create a complete graphic interface based on Slicelet concept to interface an existing software.
This software have a lot of dependencies, an among other, dependency to sqlite3, for patient database management.
when i try to import sqlite from the slicelet, i have an import error (that does not appear when launch the soft outside Slicer):
Slicer-4.8.1-linux-amd64/lib/Python/lib/python2.7/site-packages/sqlite/", line 1, in :
ImportError: No module named _sqlite

It seems that sqlite is embedded in Slicer, as i see the package: lib/Python/lib/python2.7/site-packages/sqlite
I tried to install the libsqlite3-dev package, change PYTHONPATH in a lot of ways, with no success.

I did not find any publication on this issue in the web,
do i miss something in my configuration, installation or link between Slicer and my software?

Ubuntu 16.0
Slicer 4.8.1 from Slicer web site
Python 2.7
sqlite 3.11

Thanks in advance for your help,

(Steve Pieper) #2

That’s odd, yes. I can import sqlite3 on mac but not on windows or linux. Perhaps it’s a packaging thing related to the leading underscore. You may want to have a look at the packaging scripts to see if you can fix it (or maybe manually copy things around) but also be aware that there’s going to be a transition to Python 3, within a few weeks I’m told, so things might change at that point.

(Ehouarn) #3

Hi Steve,

Thanks for the quick response,
The mac version own file in lib/Python/lib/python2.7/lib-dynload, and not the linux one, the problem come from this point i think.

Sqlite is found after copy the lib, but i am running in trouble with the USC2 vs UCS4 encoding.
I noticed at least one thread on the forum on that subject, i will have a look in the way i can launch SlicerPython directly.