I'm trying to push a Flask app on Heroku which uses an Azure SQL database with pyodbc and ODBC Driver 17 for SQL Server.
I followed the instructions from Heroku buildpack: odbc and created the following:
Aptfile:
https://github.com/heroku/heroku-buildpack-apt.git
https://github.com/heroku/heroku-buildpack-python.git
https://github.com/matt-bertoncello/python-pyodbc-buildpack.git
unixodbc
unixodbc-dev
Buildpacks:
edit:
Following heroku's website, I've added a runtime.txt with the following:
However when I push the master to heroku (git push heroku master), I get the following error:
If you are using heroku stack-22 (based on Ubuntu 22.04) then this buildpacks might not work. If what you are trying to accomplish is query from SQL server, then I would recommend using library pymssql. then you don't need any buildpacks
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.