I wrote my Python app on a windows machine and now I am trying to deploy it to Heroku. At first, my commit kept failing because it couldn't install pyodbc. To fix that, I added a Heroku build pack to preinstall a required apt package first.
I included in the Aptfile:
unixodbc
unixodbc-dev
python-pyodbc
libsqliteodbc
I was able to successfully commit but now I am receiving the following error when trying to run the app:
pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'SQL Server' : file not found (0) (SQLDriverConnect)")
Here is the SQL connection syntax in my code that is working just fine on windows:
cnxn = pyodbc.connect(driver='{SQL Server}', host='Company.database.windows.net', database='MyDatabse',trusted_connection='no', user='###', password='###')