Install & Compatibility
Where this runs
tested against v1.13.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
build_error
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 9.8s · import 9.644s · 129MB
129MB installed
● package 129MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Root
✓ from snowflake.core import Root
The primary entry point for managing Snowflake objects.
connect
✓ from snowflake.connector import connect
Used to create a SnowflakeConnection object for initializing Root.
Session
✓ from snowflake.snowpark import Session
Used to create a Snowpark Session object for initializing Root.
This quickstart demonstrates how to initialize the `Root` object, which is the entry point for managing Snowflake resources, using either a `snowflake.connector.connect` object or a `snowflake.snowpark.Session` object. It highlights the use of environment variables for secure connection parameter management.
import os
from snowflake.connector import connect
from snowflake.snowpark import Session
from snowflake.core import Root
# Option 1: Create Root instance from Snowflake Connection
connection_params = {
"account": os.environ.get("SNOWFLAKE_ACCOUNT", ""),
"user": os.environ.get("SNOWFLAKE_USER", ""),
"password": os.environ.get("SNOWFLAKE_PASSWORD", ""),
"database": os.environ.get("SNOWFLAKE_DATABASE", "test_db"),
"warehouse": os.environ.get("SNOWFLAKE_WAREHOUSE", "test_wh"),
"schema": os.environ.get("SNOWFLAKE_SCHEMA", "public"),
}
# Ensure required environment variables are set
if not all(connection_params.values()):
print("Warning: Some Snowflake connection parameters are missing. Please set SNOWFLAKE_ACCOUNT, SNOWFLAKE_USER, and SNOWFLAKE_PASSWORD environment variables.")
# Exit or handle error if connection is critical
try:
# Using snowflake.connector
connection = connect(**connection_params)
root_from_conn = Root(connection)
print(f"Root instance created from SnowflakeConnection: {root_from_conn}")
# Example: Accessing a database collection
# Assuming 'mydatabase' exists or will be created
# my_database = root_from_conn.databases["MYDATABASE"]
# print(f"Accessed database: {my_database}")
connection.close()
# Option 2: Create Root instance from Snowpark Session
# Ensure required environment variables are set for Snowpark as well if different
session = Session.builder.configs(connection_params).create()
root_from_session = Root(session)
print(f"Root instance created from Snowpark Session: {root_from_session}")
# Example: Accessing a compute pool collection
# compute_pools = root_from_session.compute_pools
# print(f"Accessed compute pools collection: {compute_pools}")
session.close()
except Exception as e:
print(f"An error occurred during quickstart: {e}")
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'snowflake.core'
The 'snowflake-core' library is not installed in the current Python environment.
fixpip install snowflake-core
snowflake.connector.errors.ProgrammingError: Failed to connect to DB: Invalid username or password.
The provided connection parameters (username, password, account, etc.) are incorrect or incomplete when establishing the Snowflake session.
fixDouble-check all connection parameters in the `configs` dictionary or ensure environment variables (e.g., `SNOWFLAKE_ACCOUNT`, `SNOWFLAKE_USER`, `SNOWFLAKE_PASSWORD`) are correctly set.
AttributeError: 'Session' object has no attribute 'execute'
The `snowflake-core` `Session` object uses the `.sql()` method to run SQL queries, not a direct `.execute()` method like `snowflake-connector-python`'s cursor.
fixUse `session.sql("YOUR_SQL_QUERY").collect()` or `session.sql("YOUR_SQL_QUERY").to_dataframe()` to execute SQL. snowflake.connector.errors.ProgrammingError: SQL compilation error: Role 'MY_ROLE' does not have sufficient privileges to perform operation 'CREATE TABLE' on schema 'MY_DB.MY_SCHEMA'.
The Snowflake role associated with the current session lacks the necessary privileges to perform the requested DDL/DML operation.
fixGrant the required privileges to the role in Snowflake using SQL, for example: `GRANT CREATE TABLE ON SCHEMA MY_DB.MY_SCHEMA TO ROLE MY_ROLE;`
Upgrade
Version history
1.13.1latest on PyPI · released Aug 12, 2026
Audit
Dependencies
PythonrequiredRequires Python 3.10 or newer.
snowflake-connector-pythonoptionalRequired for establishing a connection to Snowflake if not using Snowpark.
snowflake-snowpark-pythonoptionalRequired for establishing a Snowpark session to Snowflake if not using snowflake-connector-python.