title: Sqlite load_extension fail for spatialite in Python
body: <p>I am trying to use the Spatialite beta version 3.0 because I am using
  Windows 7 on a 64-bit machine.</p>
  
  <p>I consistently get the dreaded <code>sqlite3.OperationalError: The
  specified module could not be found.</code> error when I try to load
  <code>libspatialite-4.dll</code>.</p>
  
  <p>I have tried the following:</p>
  
  <ul>
  <li>put <code>libspatialite-4.dll</code> and all the other dlls in the same folder</li>
  <li>use the full path to the dlls</li>
  <li>add the dll location to the <code>'PATH'</code> environment variable</li>
  <li>append the dll location to the sys.path attribute as part of the Python code</li>
  <li>copy all the dlls in the <code>c:\windows\system32</code> folder (complete with restart of the machine)</li>
  <li>copy all the dlls in the <code>c:\windows\sysWoW64</code> folder (complete with restart of the machine    this is supposed to be for 32 bit dlls but I tried it anyway)</li>
  </ul>
  
  <p>my code is as follows:</p>
  
  <pre><code>import sqlite3
  conn = sqlite3.connect(":memory:")
  conn.enable_load_extension(True)
  conn.execute('SELECT load_extension("libspatialite-4.dll")')
  </code></pre>
  
  <p>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 :(</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>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)?</p>