# "django.db.utils.OperationalError: no such function: lwgeom\_version" Django Version 3.2.16, Spatialite Version 4.2.0 on Windows 10

**URL:** <https://forum.djangoproject.com/t/django-db-utils-operationalerror-no-such-function-lwgeom-version-django-version-3-2-16-spatialite-version-4-2-0-on-windows-10/17655>\
**Category:** Mystery Errors\
**Created:** [December 16, 2022, 12:38pm UTC](https://forum.djangoproject.com/t/django-db-utils-operationalerror-no-such-function-lwgeom-version-django-version-3-2-16-spatialite-version-4-2-0-on-windows-10/17655 "2022-12-16T12:38:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![123epsilon](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/123epsilon/32/11335_2.png) [@123epsilon](https://forum.djangoproject.com/u/123epsilon)\
**Post date:** [December 16, 2022, 12:38pm UTC](https://forum.djangoproject.com/t/django-db-utils-operationalerror-no-such-function-lwgeom-version-django-version-3-2-16-spatialite-version-4-2-0-on-windows-10/17655/1 "2022-12-16T12:38:52Z")

</div>

I have a Django application that uses some geographic information. I have installed GDAL and installed Spatialite by downloading the windows binaries and placing them in my python directory (conda environment in my case) as detailed in [this post](https://stackoverflow.com/questions/69975783/geo-django-3-2-django-db-utils-operationalerror-no-such-function-lwgeom-versio). That was the only way I was able to get it to work without throwing an error.

My database is set in settings.py as

```auto
    DATABASES = {
    'default': {
        # 'ENGINE': 'django.db.backends.sqlite3',
        'ENGINE': 'django.contrib.gis.db.backends.spatialite',
        'NAME': BASE_DIR / 'db.sqlite3',
        }

    }

```

When I try to test a query based on geographic coordinates such as

```auto
loc = Point(location['lng'], location['lat'])
radius = D(mi=20)

queryset = BusinessProfile.objects.filter(businessAddress __coordinates__ dwithin=(loc, 2.0)) \
            .filter(businessAddress __coordinates__ distance_lte=(loc, radius)) \
            .annotate(distance=Distance("businessAddress__coordinates", loc)) \
            .order_by("distance")

```

I get the following error:

```auto
django.db.utils.OperationalError: no such function: lwgeom_version

```

I have already installed GDAL and spatialite, can anyone help me figure out what the problem could be here?

EDIT: I’ve confirmed that GEOS, PROJ, and GDAL are installed - I have spatialite installed as I stated previously, still I have the same issue where GeoDjango can not find the function lwgeom\_version, I assume that this is an issue with my spatialite installation but I’m unsure why when I downloaded binaries from the source page.
