0

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

3
  • If you are on Azure, make sure to add that to connection, like xxxxx.east-us-2.azure Commented Nov 15, 2019 at 21:11
  • This may seem simple, but your picture doesn't indicate that you ran the import step in Jupyter. Commented Nov 15, 2019 at 21:39
  • 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
    Commented Nov 15, 2019 at 22:10

2 Answers 2

3

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.

3
  • Thanks @d.hoeffer that sounded promising but I got this error when I tried ...
    – CoolDocMan
    Commented Nov 16, 2019 at 12:41
  • Added the error above - now I get "ImportError: cannot import name 'BlockBlobService' from 'azure.storage.blob'"
    – CoolDocMan
    Commented Nov 16, 2019 at 12:47
  • That error was due to a problem with dependencies - it should be fixed in the current release. You can also do pip install azure-storage-blob==2.1.0 to work around it.
    – d.hoeffer
    Commented Nov 16, 2019 at 16:58
-1

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
    )
1
  • thanks @abhi reddy but that did not work for me (I still get "NameError: name 'snowflake' is not defined" )
    – CoolDocMan
    Commented Nov 15, 2019 at 22:01

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.