I'm trying to connect to snowflake in Python. At present I am unsuccessful. I have read forums on using the engine way i.e.:
url = URL( account = 'xxxx', user = 'xxxx', password = 'xxxx', database = 'xxx', schema = 'xxxx', warehouse = 'xxx', role='xxxxx', authenticator='
)
engine = create_engine(url)
connection = engine.connect()
query = '''
select * from MYDB.MYSCHEMA.MYTABLE
LIMIT 10;
'''
df = pd.read_sql(query, connection)but I get the error:
ModuleNotFoundError: No module named 'snowflake.sqlalchemy'How do I install this module in Anaconda? I cannot find how to get round this any other way I have read does not work.
3 Answers
This worked for me:
conda install -c conda-forge snowflake-sqlalchemy 3 dont use import snowflake together with from snowflake.sqlalchemy
use only;
from snowflake.sqlalchemy import URL
Even in an Anaconda environment you can use pip. Did you try pip install snowflake-sqlalchemy?