How does one correctly load a sqlite extension into python sqlite import?
os: Windows 7 64bit
sqlite3 version: 3.14.1 64bit
python3 version: 3.5.2 64bit
Here is my process so far: compile extension-functions.c to libsqlitefunctions.dll using this command:
gcc -shared -I "C:\Software\sqlite3\sqlite-master" -o libsqlitefunctions.dll extension-functions.c
Then I can happily use these functions in sqlite3 command line using this command:
SELECT load_extension('libsqlitefunctions.dll');
However when trying in the python script:
import sqlite3 as lite
con = lite.connect(db_file)
con.enable_load_extension(True)
con.load_extension("<<path to file>>\\libsqlitefunctions.dll")
This error appears:
Error The specified module could not be found. :
The extension-functions.c file does include the COMPILE_SQLITE_EXTENSIONS_AS_LOADABLE_MODULE section, and in fact it loads fine when using command line sqlite3
Additional notes:
The python sqlite package is installed and working correctly.
I've also tried updating the sqlite3.dll in the python path to the latest version
sqlite3package installed . Else usepip install sqlite3in your windows command prompt to install it ,and try running the code again.<<path to file>>?