Python 操作错误:250003:未能获取响应。绞刑?方法:邮寄
我正在尝试使用我的登录凭据连接到snowflake。我正在使用以下代码:Python 操作错误:250003:未能获取响应。绞刑?方法:邮寄,python,snowflake-cloud-data-platform,Python,Snowflake Cloud Data Platform,我正在尝试使用我的登录凭据连接到snowflake。我正在使用以下代码: snowflake.connector.connect( user="<my_user_name>", password="<my_password>", account="<my_account_name_with_region_and_cloud>" ) 当我尝试运行上述代码时,出现以下错误: 操作错误:250003:未能获取响应。绞刑?方法:pos
snowflake.connector.connect(
user="<my_user_name>",
password="<my_password>",
account="<my_account_name_with_region_and_cloud>"
)
当我尝试运行上述代码时,出现以下错误:
操作错误:250003:未能获取响应。绞刑?方法:post,url:
我确信我所有的包裹都是最新的。我正在使用Python3.6.4和最新的snowflake_connector_python
我目前在aws的us-east-2位置
有人能帮我解决这个问题吗???我正在使用sqlalchemy,您可以通过pip安装它:
pip install SQLAlchemy
以下是我笔记本开头的内容:
import snowflake.connector
import pandas as pd
from sqlalchemy import create_engine
from snowflake.sqlalchemy import URL
url = URL(
account = 'xxxxxxxx.east-us-2.azure',
user = 'xxxxxxxx',
password = 'xxxxxxxx',
database = 'xxxxxxxx',
schema = 'xxxxxxxx',
warehouse = 'xxxxxxxx',
role='xxxxxxxx'
)
engine = create_engine(url)
connection = engine.connect()
query = '''
select 1 AS VAL;
'''
df = pd.read_sql(query, connection)
df
如果有人帮了你,你应该选择一个答案。我们实际上需要区域和云,否则我会出错。我必须把FCXXXX.us-east-2.aws
Just Give your account name in the account .We dont need the region and full URL.
Please check below .
----------------------------------------------------------------------
import snowflake.connector
PASSWORD = '*******'
USER = '<USERNAME>'
ACCOUNT = 'SFCSUPPORT'
WAREHOUSE = '<WHNAME>'
DATABASE = '<DBNAME>'
SCHEMA = 'PUBLIC'
print("Connecting...")
# -- (> ------------------- SECTION=connect_to_snowflake --------------------
con = snowflake.connector.connect(
user=USER,
password=PASSWORD,
account=ACCOUNT,
warehouse=WAREHOUSE,
database=DATABASE,
schema=SCHEMA
)
con.cursor().execute("USE WAREHOUSE " + WAREHOUSE)
con.cursor().execute("USE DATABASE " + DATABASE)
#con.cursor().execute("USE SCHEMA INFORMATION_SCHEMA")
try:
result = con.cursor().execute("Select * from <TABLE>")
result_list = result.fetchall()
print(result_list)
finally:
con.cursor().close()
con.cursor().close()