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.