When I try to connect to a sql server database with pyodbc (on mac):
import pyodbc
server = \'####\'
database = \'####\'
username = \'####@####\'
password =
In my case, I had to change the pyodbc database driver string to
driver='{ODBC Driver 17 for SQL Server}'
actually, in my python code pyodbc was expecting ODBC Driver 13 but, as the ODBC Driver version was updated (because of ubuntu update) to current version ODBC Driver 17, the problem had occurred.