0
votes

I sucessfully installed and setup Anaconda Navigator withb python 3.7, launched Jupyter Notebook and can run Python 3.7.

Next, I installed the python-snowflake connector using ...

*pip install --upgrade snowflake-connector-python* 

Then I start up Anaconda, open a jupyter notebook and use the sample connector code (https://docs.snowflake.net/manuals/user-guide/python-connector-install.html) with parameters set as shown. I get a error message ImportError: cannot import name 'BlockBlobService' from 'azure.storage.blob'

How should I go about fixing this? Do I need to set some more environment parameters in Anaconda before launching Jupyter Notebook? If so how?

enter image description here

2
If you are on Azure, make sure to add that to connection, like xxxxx.east-us-2.azuredemircioglu
This may seem simple, but your picture doesn't indicate that you ran the import step in Jupyter.Mike Walton
Thanks Mike Walton - but I am not sure how to add the Snowflake environment in Anaconda so that its available to the laucnhed jupyter notebook. Can you advise how?CoolDocMan

2 Answers

3
votes

You didn't execute the first cell in your notebook, the one where you do import snowflake.connector. When you execute it, you'll see In: [1] to the left of it, while now it shows In: []. The consequence of this is that Python doesn't know what to do with the reference to "snowflake", and that's what the error message means.

If you don't have Snowflake's Python SDK installed, as your comment indicates, you can open a Anaconda prompt and run pip install snowflake-connector-python.

0
votes

Defining connection details like this worked for me

uname=''

pword=''

acct='xyz.us-east-1'

whouse=''

# connect to Snowflake

ctx = snowflake.connector.connect(

    user=uname,

    password=pword,

    account=acct
    )