How do i install snowflake.sqlalchemy in anaconda?

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

4

Even in an Anaconda environment you can use pip. Did you try pip install snowflake-sqlalchemy?

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like