Pyodbc on Airflow

Hi, everyone,

I was hoping to use pyodbc to interact with a Microsoft SQL Server database. I wrote a helper module that imports pyodbc and everything works great in my local IDE.

I created a new CLI instance and pip installed pyodbc. However, if I try to load a DAG that references the helper module Airflow says “no module named pyodbc”.

Has anyone had any success with pyodbc on Airflow? If so, what am I missing?

Thanks!

FYI - I solved this today.
I ended up needing to follow the steps listed here: https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-ver15 among some other setup within my environment.

I can successfully access SQL Server databases using a database-authenticated user.

1 Like