[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

load extention spatialite in sqlite on windows

I tried to reproduce this( in windows. How can I do that?

I'm using Windows 10, my project use Pyramid Framework with Python 3.6.8.

Even though I put the dll file in a directory defined in %PATH% or try with/without full path, with/without file extension, with '//' or '\', with libspatialite-4.dll or using excute with all combination mentionned before... dbapi_conn.execute("SELECT load_extension('mod_spatialite.dll')")

For example i tried this kind of combinaison:

def load_spatialite(dbapi_conn, connection_record):
 dbapi_conn.load_extension('C:\\mydll\\mod_spatialite.dll') # dbapi_conn.load_extension('C:\\mydll\\libspatialite-4.dll')
 # dbapi_conn.load_extension('mod_spatialite')
 # dbapi_conn.load_extension('mod_spatialite.dll')
 # dbapi_conn.execute("SELECT load_extension('C:\\mydll\\mod_spatialite.dll')")
 # dbapi_conn.execute("SELECT load_extension('mod_spatialite.dll')") # dbapi_conn.execute("SELECT load_extension('mod_spatialite')") # dbapi_conn.load_extension('C:/mydll\mod_spatialite.dll')

Can make it work, always getting:
dbapi_conn.load_extension('C:\\mydll\\mod_spatialite.dll')sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) OsError 0xc1 (193)
(Background on this error at:
( '';return true;" onmousedown="this.href='';return true;" style="CURSOR: pointer; TEXT-DECORATION: none; BORDER-TOP: 0px; BORDER-RIGHT: 0px; BORDER-BOTTOM: 0px; COLOR: rgb(102,17,204); PADDING-BOTTOM: 0px; PADDING-TOP: 0px; PADDING-LEFT: 0px; MARGIN: 0px; BORDER-LEFT: 0px; PADDING-RIGHT: 0px" href="" rel=nofollow target=_blank) 
I've been told to use import sqlite3 so I make it a try with this code:
    conn = sqlite3.connect(":memory:")
    conn.load_extension('c:\\mydll\\mod_spatialite') Try too with 'c:/mydll/mod_sptatialite' But I got the same error.

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) OsError 0xc1 (193)
(Background on this error at:


My directory contain the unzip of:
The directory is set in %PATH%

Any hint will be appreciated.