请帮我弄清楚。代码工作到上周五没有问题。今天经过几次启动,我一直得到错误:
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(SSLCertVerificationError(1,'[SSL:CERTIFICATE_VERIFY_FAILITY] certificate verify failed:unable to get local issuer certificate(_ssl.c:1007')))
我既不能下载也不能发送数据到Big Query。
import pandas as pd
from dotenv import load_dotenv
from google.cloud import bigquery
load_dotenv('.env')
def create_bq_conn():
CREDS_BIG_QUERY = r'C:\Users\path_to_file\some_creds.json'
bclient = bigquery.Client.from_service_account_json(json_credentials_path=CREDS_BIG_QUERY)
return bclient
def result_df():
query_job = create_bq_conn().query('SELECT * FROM `table`')
bqdf = query_job.to_dataframe()
return bqdf
result_df()
字符串
1条答案
按热度按时间zyfwsgd61#
解决此SSL错误的许多解决方法之一是使用
pip install certifi
或pip install --upgrade certifi
(如果您已经安装了它)。您可以使用以下语法确定证书的路径:
字符串
将生成路径文件:
型
现在,你可以传递路径来验证:
型