Which dependencies are need so that the binaries run?

39 views
Skip to first unread message

Sam Gothman

unread,
Nov 2, 2025, 9:57:53 AM (6 days ago) Nov 2
to SpatiaLite Users
New to spatialite and try to run the binaries in python. Unfortunately I don't succeed. What else needs to be installed so that spatialite works except from sqlite?

Thanks for any help!

Cheers!

sandro furieri

unread,
Nov 2, 2025, 10:51:49 AM (6 days ago) Nov 2
to spatiali...@googlegroups.com
Il 2025-11-02 15:52 Sam Gothman ha scritto:
> New to spatialite and try to run the binaries in python. Unfortunately
> I don't succeed. What else needs to be installed so that spatialite
> works except from sqlite?
>

Hi Sam,

the canonical way to load SpatiaLite in Python is as follows:

1) First open a SQLite connection.
2) Then dynamically load the "mod_spatialite" extension module
by executing this SQLite command:

SELECT load_extension('mod_spatialite');

If all goes well, all Spatial SQL functions will be available
at this point, and then you can use them in the SQL queries
where the problems lie:you pass to SQLite.

Where the problems lie:
a) The dynamic extension module "mod_spatialite" must be located
in one of the standard directories where the operating system
and Python look for libraries (*.so on Linux, *.dll on Windows),
otherwise load_extension() will fail returning an error because
it's unable to locate the module to be loaded.
b) But all the many dependencies required by "mod_spatialite" must
also be loaded at the same time, otherwise the loading will fail
due to unresolved dependencies.

At this point it all depends on the operating system you are using.
On Linux it's all reasonably simple and easy, but on Windows it can
easily become a real nightmare, also because on this o.s. you will
receive very poor error messages that will not help you at all to
identify what exactly is preventing the extension module from loading.

To make installation less painful on Windows, you should download
this package, which certainly contains "mod_spatialite" with all
its dependencies:

https://www.gaia-gis.it/gaia-sins/windows-bin-amd64/mod_spatialite-5.1.0-win-amd64.7z

Note: all DLLs and other files in the package must be copied into
the same folder, which must of course be included in the standard
Windows and Python load paths.

If you continue to encounter problems, post a new message specifying
better which operating system you are working on, and possibly
include an example of the Python code that you use to load the
extension, including any error messages.

bye Sandro

Sam Gothman

unread,
Nov 2, 2025, 10:53:00 AM (6 days ago) Nov 2
to SpatiaLite Users
P.S.: I have no GIS or other similar software installed except python. So .dll files or .exe files which might be considered mandatory by other users are unknown to me. Just trying to get into spatial queries, no further background than that. Thanks!

sandro furieri

unread,
Nov 2, 2025, 11:14:52 AM (6 days ago) Nov 2
to spatiali...@googlegroups.com
Il 2025-11-02 16:35 Sam Gothman ha scritto:
> P.S.: I have no GIS or other similar software installed except python.
> So .dll files or .exe files which might be considered mandatory by
> other users are unknown to me. Just trying to get into spatial
> queries, no further background than that. Thanks!
>

very good, so at least now we know you're using Windows.
Try installing the package I mentioned in my previous email.

bye Sandro

Pieter Roggemans

unread,
Nov 3, 2025, 12:01:25 PM (4 days ago) Nov 3
to SpatiaLite Users
As you are working from python... If you would be used to working with conda(-forge), libspatialite is also available there: https://anaconda.org/conda-forge/libspatialite

Op zondag 2 november 2025 om 17:14:52 UTC+1 schreef sandro furieri:

Sam Gothman

unread,
Nov 4, 2025, 3:00:10 AM (4 days ago) Nov 4
to SpatiaLite Users
Thanks for all your help! Managed  run it finally.
Reply all
Reply to author
Forward
0 new messages