No module named Snowflake found

I am working on a notebook on a SageMaker instance at my work. My goal is to connect my jupyter notebook to the snowflake database so as to query some data. Here are some details regarding my problem;

(practiceenv) sh-4.2$ python --version Python 3.8.6 

In the same environment, I did run the command;

conda list 

And I could see the package;

# Name Version Build Channel snowflake-connector-python 2.3.10 py38h51da96c_0 conda-forge 

So it seems the correct package is there. Next, I did create a jupyter notebook(condapython3 kernel) in the same environment and tried to import the package

import snowflake.connector ModuleNotFoundError: No module named 'snowflake 

I was able to get the dependencies installed. Please see the screenshot.enter image description here May I get some help on how to debug this error? Help is appreciated.

1

4 Answers

pip install snowflake-connector-python 

Have you tried it in jupyter-notebook?

3

Uninstall snowflake first (pip uninstall snowflake)

Then install snowflake again(pip install snowflake-connector-python==2.8.3)

This should resolve the issue.

1

You can make use of pip install snowflake.sqlalchemy with this you can get well with the connector you are looking for.

1

I ran into the same error while sourcing a Python script from the R terminal (using the reticulate package). The R terminal was launched from the base conda environment. First I tried pip install snowflake-connector-python in the base environment and also in the native Python environment (conda deactivated), but it didn't work. I managed to fix the problem by opening the R terminal in the base environment and installing the Snowflake connector with reticulate:

reticulate::py_install("snowflake-connector-python") 

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