# 'mssql' isn't an available database backend or couldn't be imported.

**URL:** https://forum.djangoproject.com/t/mssql-isnt-an-available-database-backend-or-couldnt-be-imported/45188
**Category:** Mystery Errors
**Created:** [May 26, 2026, 8:57am UTC](https://forum.djangoproject.com/t/mssql-isnt-an-available-database-backend-or-couldnt-be-imported/45188 "2026-05-26T08:57:07Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![F2Andy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/f2andy/32/29160_2.png) [@F2Andy](https://forum.djangoproject.com/u/F2Andy)
#### Post date: [May 26, 2026, 8:57am UTC](https://forum.djangoproject.com/t/mssql-isnt-an-available-database-backend-or-couldnt-be-imported/45188/1 "2026-05-26T08:57:07Z")

</div>

I have a Django project that access two databases - one is PostgreSQL and one is MS SQL Server. This was working fine until I upgraded Pythan from 3.12 or 3.13 to 3.14.5.

I then have to install the various bits as well,

```auto
pip install django
pip install reportlab
pip install psycopg2-binary
pip install sql_server.pyodbc
pip install pyodbc
pip install mssql-django
pip install python-dateutil

```

The SQL Server drivers are from here, by the way: [mssql-django · PyPI](https://pypi.org/project/mssql-django/)

But when I then try to run unit tests, it refuses, saying:

django.core.exceptions.ImproperlyConfigured: ‘mssql’ isn’t an available database backend or couldn’t be imported. Check the above exception. To use one of the built-in backends, use ‘django.db.backends.XXX’, where XXX is one of:  
‘mysql’, ‘oracle’, ‘postgresql’, ‘sqlite3’

I can go into th Django shell okay. I can do runserver okay.

I do not have SQL Server on my development PC; it is only used by one app, and then only in odd circumstances, so the tests do not use it. But something causes the test suite to fail anyway during set up.

---

<div class="post-metadata">

### Author: ![F2Andy](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/f2andy/32/29160_2.png) [@F2Andy](https://forum.djangoproject.com/u/F2Andy)
#### Post date: [May 26, 2026, 12:49pm UTC](https://forum.djangoproject.com/t/mssql-isnt-an-available-database-backend-or-couldnt-be-imported/45188/2 "2026-05-26T12:49:14Z")

</div>

Oh, well this is embarassing. The solution was here all the time:

> [@'mssql' (also tried 'sql\_server.pyodbc) isn't an available database backend or couldn't be imported](https://forum.djangoproject.com/t/mssql-also-tried-sql-server-pyodbc-isnt-an-available-database-backend-or-couldnt-be-imported/24808/5):
>
> I had this exact same issue and there is NOTHING online that fixed it until I finally, FINALLY, discovered the source of the issue on my own. I don’t know if this is the same problem everyone with this issue is running into, but I have not seen a SINGLE mention of it in any online discussion, package documentation, or thread ANYWHERE. The cause of this issue? (for me at least): At some poin the naming convention of the top-level folder that gets installed by the ‘mssql’ package was changed. Y…

Something somewhere is expecting MsSql in settings.DATABASES rather than mssql.

---

<div class="post-metadata">

### Author: ![amirreza8002](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/amirreza8002/32/27683_2.png) [@amirreza8002](https://forum.djangoproject.com/u/amirreza8002)
#### Post date: [May 27, 2026, 11:09pm UTC](https://forum.djangoproject.com/t/mssql-isnt-an-available-database-backend-or-couldnt-be-imported/45188/3 "2026-05-27T23:09:06Z")

</div>

changing the name in venv seems like bad advice.  
it was packaged like that by maintainers

if that is the name of the package, it should be used in the string pointing to the backend

and if you feel like this is a bug, it should be reported to them so they fix the packaging, or the docs
