I am trying to use the Spatialite beta version 3.0 because I am using Windows 7 on a 64-bit machine.
I consistently get the dreaded sqlite3.OperationalError: The
specified module could not be found.
error when I try to load
libspatialite-4.dll
.
I have tried the following:
libspatialite-4.dll
and all the other dlls in the same folder'PATH'
environment variablec:\windows\system32
folder (complete with restart of the machine)c:\windows\sysWoW64
folder (complete with restart of the machine this is supposed to be for 32 bit dlls but I tried it anyway)my code is as follows:
import sqlite3
conn = sqlite3.connect(":memory:")
conn.enable_load_extension(True)
conn.execute('SELECT load_extension("libspatialite-4.dll")')
NOTE - I have tried the full path too with no luck. I remember having the same problem with Windows XP 32-bit. I got it working but can't remember what I did :(
UPDATE
I have tested the setup on 32-bit Windows 7 and putting all the dlls in the System32 folder works. So, this suggests that there is some problem with the 64-bit setup. Could it be that I need another version of MSVC (I don't think the Spatialite website says which is necessary so I might just have to guess - I have MSVC2010 installed)?
I was having the same problem and it confused me for days. I'm running Python 2.6 (32-bit) on Windows 7(x64), so it may not be the same setup as you have.
Here's what you can try (taken from this Google Groups post):
The problems seems to be that Windows may not load the dlls from C:\Windows\system32 because of user permissions settings.