"Unable to locate the SpatiaLite library." Django
<p>I'm trying to make Django's SQLite3 accept spatial queries. <a href="https://docs.djangoproject.com/en/1.10/ref/contrib/gis/install/spatialite/" rel="nofollow">This tutorial</a> suggests that I add this to settings:</p>

<pre><code>SPATIALITE_LIBRARY_PATH = 'mod_spatialite'
</code></pre>

<p>Which produces this error:</p>

<blockquote>
  <p>django.core.exceptions.ImproperlyConfigured: Unable to load the
  SpatiaLite library extension "mod_spatialite" because: The specified
  module could not be found.</p>
</blockquote>

<p>I also tried doing this : </p>

<pre><code>SPATIALITE_LIBRARY_PATH = r'C:\\Program Files (x86)\\Spatialite\\mod_spatialite-4.3.0a-win-x86\\mod_spatialite-4.3.0a-win-x86\\mod_spatialite.dll'
</code></pre>

<p>If I don't add this variable I receive this error when I migrate:</p>

<blockquote>
  <p>django.core.exceptions.ImproperlyConfigured: Unable to locate the
  SpatiaLite library. Make sure it is in your library path, or set
  SPATIALITE_LIBRARY_PATH in your settings.</p>
</blockquote>

<p>Thank you..</p>

<p>This is how to install SpatiaLite (almost) inside virtualenv for Python 3:</p>

<ol>
<li>Download <a href="http://sourceforge.net/projects/cyqlite/" rel="nofollow">cyqlite</a> a special SQLite build with R-Tree enabled. It is <a href="https://docs.djangoproject.com/en/1.10/ref/contrib/gis/install/spatialite/#sqlite" rel="nofollow">required by GoeDjango</a>.</li>
<li>Download <a href="http://www.gaia-gis.it/gaia-sins/" rel="nofollow">mod_spatialite</a> (Windows binaries are in the pink box at the bottom of the page) i.e. <code>mod_spatialite-[version]-win-x86.7z</code></li>
<li>Unzip mod_spatialite files (flatten the tree and ignore the folder in the archive) into the virtuelenv <code>Scripts</code> folder. </li>
</ol>

<p>This part I don't like but I not could find a workable solution without touching main Python3 installation. </p>

<ol start="5">
<li>Rename or otherwise backup <code>c:\Python35\DLLs\sqlite3.dll</code></li>
<li>From <code>cyqlite</code> uznip <code>sqlite3.dll</code> file into the <code>c:\Python35\DLLs\</code></li>
</ol>

<hr>

<p>Kudos: <a href="http://gis.stackexchange.com/a/169979/84121">http://gis.stackexchange.com/a/169979/84121</a></p>

python django sqlite3 spatial geodjango