-1

I am trying to import pyodbc to use in my cloud function to access SQL Server.

I have added pyodbc and unixODBC in requirements.txt and importing in main.py files.

I could not deploy cloud function due to some import issues.

ERROR: Could not find a version that satisfies the requirement unixODBC (from versions: none) ERROR: No matching distribution found for unixODBC; Error ID: 656dd225

Is anything additionally I need to do?

O. Jones
  • 103,626
  • 17
  • 118
  • 172
Sekhar
  • 627
  • 4
  • 14
  • 34
  • I could be mistaken but I thought that [`requirements.txt`](https://pip.pypa.io/en/stable/reference/requirements-file-format/) was only used to install Python modules via `pip`. If you can't figure out a way to install `unixodbc` as well as the required `ODBC Driver (version) for SQL Server`, have you considered trying a pure Python solution such as `pytds`? – AlwaysLearning Aug 08 '23 at 08:35
  • My function should trigger on the file arrival in GCS bucket and then insert rows. Hence I have only option to do with Cloud Functions. – Sekhar Aug 08 '23 at 10:30
  • I didn't say to avoid Cloud Functions, I was suggesting to use an all-Python solution to access SQL Server without external dependencies. – AlwaysLearning Aug 08 '23 at 10:33
  • We can but due to performance optimization point of view I am thinking about `pyodbc` because it has fast_executemany option to handle bulk batch. – Sekhar Aug 08 '23 at 10:37

0 Answers0