I'm trying to create a Flask API that will receive an ID by GET APand return data coming from Big Query.
from google.cloud import bigquery
from google.oauth2 import service_account
credentials = service_account.Credentials.from_service_account_file(SERVICE_FILE)
project_id = PROJECT_ID
client = bigquery.Client(credentials= credentials,project=project_id)
query_job = client.query("""
SELECT *
FROM TABLES
LIMIT 1000 """)
self.df = query_job.result().to_dataframe()
Everything is working all right when I run this code from a Jupyter notebook. But as soon as I try to run it from my Flask App in Visual Studio code, I am getting the following error :
google.api_core.exceptions.RetryError: Deadline of 600.0s exceeded while calling target function, last exception: HTTPSConnectionPool(host='oauth2.googleapis.com', port=443): Max retries exceeded with url: /token (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available."))
I'm working with Python 3.8 and Windows 11. Do you have any ideas of what I'm missing here ?
Thank you !