'sql_server.pyodbc' isn't an available database backend.
See original GitHub issueHi all,
I get the following error when doing runserver:
django.core.exceptions.ImproperlyConfigured: 'sql_server.pyodbc' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3'
My configuration in settings is like that:
{'NAME': '***',
'USER': '***',
'PASSWORD': '***',
'HOST': '192.168.10.70',
'PORT': '',
'ENGINE': 'sql_server.pyodbc',
'OPTIONS': {'driver': 'ODBC Driver 17 for SQL Server'}
}
The library seems to be installed, this import works without errors:
import sql_server.pyodbc
Any help appreciated.
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
Django python 'sql_server.pyodbc' isn't an available database ...
I removed the django-pyodbc-azure and django-mssql-backend packages since they only support the older django versions.
Read more >Error when trying to conect to MS SQL backend - Django Forum
ImproperlyConfigured'>, ImproperlyConfigured("'sql_server.pyodbc' isn't an available database backend or couldn't be imported.
Read more >Django python 'sql_server.pyodbc' isn't an available database ...
ImproperlyConfigured: 'sql_server.pyodbc' isn't an available database backend. Try using 'django.db.backends.XXX', where XXX is one of: 'mysql', 'oracle', ...
Read more >4.3. Databases and database drivers - CRATE - Read the Docs
For SQL Server: with Django use django-mssql-backend, and with SQLAlchemy use pyodbc, both via ODBC. For the ODBC drivers: under Windows, use native...
Read more >Django SQL server connection not working in Pycharm
"%r isn't an available database backend or couldn't be " "imported. ... Obviously sql_server.pyodbc is not in django.db.backends.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had the same issue and symptoms on Django 3.0.3, packages installed via pipenv. In my case, I was using the original
django-pyodbc-azure
package and switched over todjango-mssql-backend
. For me, I had installed the new package and then uninstalled the old one, meaning that I had a conflict because both packages use the same namespace. In other words,sql_server.pyodbc
could be imported fine but it was an empty module which caused Django to error here assql_server.pyodbc.base
couldn’t be imported. I solved my issue with:This one worked for me