cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

snowflake python connector import error

nyck33
New Contributor II

```

--------------------------------------------------------------------------- ImportError Traceback (most recent call last) File <command-1961894174266859>:1 ----> 1 con = snowflake.connector.connect( 2 user=USER, 3 password=SNOWSQL_PWD, 4 account=ACCOUNT, 5 warehouse=WAREHOUSE, 6 database=DATABASE, 7 schema=SCHEMA 8 ) File /local_disk0/.ephemeral_nfs/envs/pythonEnv-19827119-02a3-470d-a680-956e941ee526/lib/python3.9/site-packages/snowflake/connector/__init__.py:54, in Connect(**kwargs) 52 @wraps(SnowflakeConnection.__init__) 53 def Connect(**kwargs) -> SnowflakeConnection: ---> 54 return SnowflakeConnection(**kwargs) File /local_disk0/.ephemeral_nfs/envs/pythonEnv-19827119-02a3-470d-a680-956e941ee526/lib/python3.9/site-packages/snowflake/connector/connection.py:389, in SnowflakeConnection.__init__(self, connection_name, connections_file_path, **kwargs) 387 kwargs = _get_default_connection_params() 388 self.__set_error_attributes()

```

My notebook:

https://community.cloud.databricks.com/?o=4985334090966031#notebook/1961894174266855/command/1961894...

 

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @nyck33 , It appears that you’re encountering an ImportError related to the snowflake-connector-python package. 

 

Let’s troubleshoot this issue:

 

Module Not Found:

  • The error message indicates that Python cannot find the library snowflake-connector-python.
  • Ensure that you have explicitly installed the package using:pip install snowflake-connector-python

Version Compatibility:

File Naming Conflict:

Explicit Import:

  • Try importing the connector module explicitly:

Check Dependencies:

  • Ensure that you don’t have multiple versions of the Snowflake package installed.
  • If you’re specifically using the connector, uninstall any other conflicting packages:pip uninstall snowflake

Workspace Environment:

  • Confirm that you’re running your code in the correct environment (e.g., virtual environment or main Python environment).

Remember to follow these steps one by one to identify the root cause.

 

 If the issue persists, consider checking your notebook settings and verifying the package installation. 🚀.

Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!