lundi 12 janvier 2015

Use spatialite extension for SQLite on Windows

I know that this has been asked in some similar ways before. However, all questions I found on this dealt with some very specific system setups which were not applicable for me (because so is mine).


System:



  • Windows 7 64bit

  • Python 3.4 64bit

  • sqlite3 2.6.0 (shipped with Python I guess)

  • Spatialite Windows binaries 2.3.1 (anything else of importance?)


How can I activate the spatialite extension for the ´sqlite3´ module?


What I tried (the way that other people in similar questions say it works):



  • Downloading from http://ift.tt/14M0Zem :

    • libspatialite-win-x86-2.3.1.zip

    • proj-win-x86-4.6.1.zip

    • geos-win-x86-3.1.1.zip

    • libiconv-win-x86-1.9.2.zip



  • unzipping all of them into the same folder on C:\

  • (also tried only putting the DLLs into that folder)

  • putting that folder into my system PATH variable


Then, running



import sqlite3

conn = sqlite3.connect(":memory:")
conn.enable_load_extension(True)
conn.execute('SELECT load_extension("libspatialite-2.dll")')


gives



conn.execute("SELECT load_extension('libspatialite-2.dll')")
sqlite3.OperationalError: The specified module could not be found.


What more can I try to make this work?


Aucun commentaire:

Enregistrer un commentaire