[Django]-How to fix pyodbc dependency errors when upgrade Django from 2.1 to 2.2.13?

3👍

django-pyodbc-azure is no longer maintained, unfortunately. There’s a new package you can use which works as a drop-in replacement. It supports Django 2.2 and 3.0.

https://pypi.org/project/django-mssql-backend/

I’d recommend that you entirely remove all references to pyodbc, django-pyodbc, and django-pyodbc-azure. Then update your dependencies (for example, in a Pipfile or requirements.txt) to add:

django-mssql-backend==2.8.1
django>=2.2,<3

Give that a try in a new virtual environment when you get a chance to ensure you don’t have django-pyodbc-azure hanging around. If you have any further problems we can work through them in comments and amend the answer. I don’t think you’ll need it, but I have a more in depth guide available here: https://www.pyphilly.org/django-and-sql-server-2020-edition/

Leave a comment