0

I have a Python Script that gets a BigQuery query to a Pandas Dataframe and then exports to my SQL Server Database.

I can run that perfectly on a Jupyter Notebook, but when I run the script on SQL Server Agent it gives the error "No module named Google".

This because I am importing from google.oauth2 import service_account

Can someone please help?

Cookye
  • 23
  • 4
  • How are you running the Python from SQL Server agent? If you're using SQL Server's Python for Machine Learning, have you [installed the module](https://learn.microsoft.com/en-us/sql/machine-learning/package-management/install-additional-python-packages-on-sql-server?view=sql-server-ver15) in SQL Server's Python Environment? (It doesn't use the same Python Environment you would be using.) – Thom A Nov 02 '21 at 17:05
  • I know, I installed using pip in the Python folder inside the SQL Server folder. I just tried running the script in cmd and he runs smoothly there. I start thinking google doesn't allow SQL Server to use its libraries – Cookye Nov 02 '21 at 17:22
  • 1
    The fact that you're getting *"No module named Google"* implies that the module has not been installed inside SQL Server's Python environment. – Thom A Nov 02 '21 at 18:05

0 Answers0