Reputation: 1463
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. May I get some help on how to debug this error?
Upvotes: 12
Views: 93766
Reputation: 36
Maybe your filename is snowflake.py or something (this was my problem) Found this on reddit: https://www.reddit.com/r/snowflake/comments/177uhoy/modulenotfounderror_no_module_named/
Upvotes: 1
Reputation: 161
Uninstall snowflake first (pip uninstall snowflake)
Then install snowflake again(pip install snowflake-connector-python==2.8.3)
This should resolve the issue.
Upvotes: 16
Reputation: 41
You can make use of pip install snowflake.sqlalchemy with this you can get well with the connector you are looking for.
Upvotes: 4
Reputation: 581
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")
Upvotes: 0
Reputation: 395
pip install snowflake-connector-python
Have you tried it in jupyter-notebook?
Upvotes: 15