connect to sql server from mac via sqlalchemy

Viewed 7

I am switching from windows to mac. the below code works fine in windows. what would I have to adapt please? I get:

pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server Native Client 11.0' : file not found (0) (SQLDriverConnect)")

import urllib
import sqlalchemy as sa

def get_engine():
    connection_string = urllib.parse.quote_plus(
            "DRIVER={SQL Server Native Client 11.0};" 
            "SERVER=bla
            "DATABASE=bla
            "Trusted_Connection=yes"
        )
    return sa.create_engine("mssql+pyodbc:///?odbc_connect={}".format(connection_string))
1 Answers
Related