No module named Snowflake found

Viewed 23232

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.

3 Answers
pip install snowflake-connector-python

Have you tried it in jupyter-notebook?

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

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")
Related