ODBC drivers on Render

My web app communicates with a SQL database hosted on Azure. To communicate and read/write data to it, I use the library pyodbc. Unfortunately, I am getting errors on render that say I don’t have the ODBC drivers for it.

Nov 23 04:04:23 PM    File "/opt/render/project/src/.venv/lib/python3.7/site-packages/scrapy/utils/misc.py", line 172, in create_instance
Nov 23 04:04:23 PM      instance = objcls(*args, **kwargs)
Nov 23 04:04:23 PM    File "/opt/render/project/src/app/part_scraper/pipelines.py", line 26, in __init__
Nov 23 04:04:23 PM      with pyodbc.connect(self.connection_string) as conn:
Nov 23 04:04:23 PM  pyodbc.Error: ('01000', "[01000] [unixODBC][Driver Manager]Can't open lib 'ODBC Driver 17 for SQL Server' : file not found (0) (SQLDriverConnect)")

Is there any way I can install the ODBC drivers or is not possible right now?

Thanks in advance!

Hi @gokul, can you tell me which service is having this issue so I can take a look?

Hey @tyler, thanks for the reply.

The problem was that I was not able to install ODBC drivers globally on Render so I solved it by building my app using a Dockerfile, in which I put the commands to install the drivers.

It’s working now without any problems.

Hi @gokul, sorry to revive this post.

I’ve been trying to deploy a simple flask api connected to a client’s MSSQL database. I was running into the same issue with pyodbc. After creating a docker container and installing ODBC Driver 17 the following error appears when trying to make a request:

sqlalchemy.exc.OperationalError: (pyodbc.OperationalError) (‘HYT00’, ‘[HYT00] [Microsoft][ODBC Driver 17 for SQL Server]Login timeout expired (0) (SQLDriverConnect)’)

Did you come across the same error? If so, how did you bypass it?

Any other advice when deploying on render would be much apreciated.

Thanks in advance.

Hi Gokul, Please if you can let me know the steps install the ODBC Driver. i am working with pyodbc as well and stuck with driver issue.

Thanks/Shashi

Edit: I was able to make one myself. now i am troubleshooting some other issue. Thanks