Installation¶
geopackage-toolkit requires SpatiaLite to be installed on your system. The Python package itself has zero compiled dependencies.
Prerequisites: SpatiaLite¶
SpatiaLite is a SQLite extension that adds spatial SQL support. It must be available as a shared library on your system.
Windows¶
-
Download the latest SpatiaLite binaries from gaia-gis.it:
- Get
mod_spatialite-5.1.0-amd64.exe(or latest version) - Extract to
C:\spatialite
- Get
-
Set the environment variable:
-
Verify the DLL exists:
Note
If you see RuntimeError: Failed to load SpatiaLite, check that mod_spatialite.dll exists in the SPATIALITE_DIR directory.
Ubuntu / Debian¶
SpatiaLite loads automatically on Linux (no environment variable needed).
macOS¶
Conda¶
Docker¶
FROM python:3.12-slim
RUN apt-get update && apt-get install -y libspatialite-dev && rm -rf /var/lib/apt/lists/*
RUN pip install geopackage-toolkit
Installing the Python Package¶
From PyPI (recommended)¶
From Source¶
With Development Dependencies¶
This installs pytest for running tests.
Verifying Installation¶
from geopkgtoolkit import connect, validate_layers
print("geopackage-toolkit installed successfully")
Or use the CLI:
Troubleshooting¶
"Failed to load SpatiaLite"¶
Cause: SpatiaLite shared library not found.
Fix:
-
Verify SpatiaLite is installed:
- Windows: Check
C:\spatialite\mod_spatialite.dllexists - Linux: Run
dpkg -l | grep spatialite - macOS: Run
brew list libspatialite
- Windows: Check
-
Set the correct path:
- Windows: Set
SPATIALITE_DIRenvironment variable - Linux/macOS: Usually automatic; check library path with
ldconfig -p | grep spatialite
- Windows: Set
"No module named 'geopkgtoolkit'"¶
Cause: Package not installed or wrong Python environment.
Fix:
Windows: "DLL load failed"¶
Cause: Missing Visual C++ runtime or architecture mismatch (32-bit Python with 64-bit SpatiaLite).
Fix:
- Ensure you are using 64-bit Python with 64-bit SpatiaLite
- Install Visual C++ Redistributable
System Requirements¶
| Component | Requirement |
|---|---|
| Python | 3.10 or later |
| SpatiaLite | 5.0 or later (recommended) |
| OS | Windows, Linux, macOS |
| Disk | <1 MB for the package itself |
| RAM | Depends on your data |
Next Steps¶
Once installed, head to the Quick Start guide to validate and query your first GeoPackage.