I can not get rid of the error.
django.db.utils.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 13 for SQL Server' : file not found (0) (SQLDriverConnect)")
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-buildpack-apt
unixodbc
unixodbc-dev
python-pyodbc
libsqliteodbc
https://packages.microsoft.com/ubuntu/16.04/prod/pool/main/m/msodbcsql/msodbcsql_13.1.9.2-1_amd64.deb
...
pyodbc
django-pyodbc-azure
DATABASES = {
'default': {
'ENGINE': 'sql_server.pyodbc',
'NAME': '',
'USER': '',
'PASSWORD': '',
'HOST': '',
'PORT': '',
'OPTIONS': {
'driver': 'ODBC Driver 13 for SQL Server',
'MARS_Connection': 'True',
}
}
}
How to fix this error I do not know
I believe this can be solved with the same methodology as a similar question Python cant find ODBC Driver on Heroku after setting everything.
tldr: the solution was to precompile ODBC Driver 17 for SQL Server on an Ubuntu 18.04 environment and copy the required driver files over to Heroku via this buildpack https://github.com/matt-bertoncello/python-pyodbc-buildpack.git
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With