Install & Compatibility
Where this runs
tested against v3.29.11 · 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
installs and imports cleanly · install 0.0s · import 0.358s · 23.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 5.0s · import 0.226s · 35MB
27MB installed
● package 27MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Cluster
✓ from cassandra.cluster import Cluster
✗ from scylla_driver.cluster import Cluster
The Scylla driver uses the 'cassandra' namespace for its core components, even though the package is installed as 'scylla-driver'. This can be a common point of confusion for new users.
Session
✓ from cassandra.cluster import Cluster; session = cluster.connect()
Session objects are created from a Cluster instance.
PlainTextAuthProvider
✓ from cassandra.auth import PlainTextAuthProvider
Used for plain-text username/password authentication.
This quickstart demonstrates how to establish a connection to a ScyllaDB or Cassandra cluster, create a keyspace and table, insert data, and retrieve it. It uses environment variables for credentials, suitable for secure deployment.
import os
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
# Replace with your ScyllaDB/Cassandra contact points and credentials
CONTACT_POINTS = os.environ.get('SCYLLA_CONTACT_POINTS', '127.0.0.1').split(',')
USERNAME = os.environ.get('SCYLLA_USERNAME', 'scylla')
PASSWORD = os.environ.get('SCYLLA_PASSWORD', 'password')
auth_provider = PlainTextAuthProvider(username=USERNAME, password=PASSWORD)
cluster = None
session = None
try:
cluster = Cluster(contact_points=CONTACT_POINTS, auth_provider=auth_provider)
session = cluster.connect()
# Example: Create a keyspace and table (if they don't exist)
session.execute(
"""CREATE KEYSPACE IF NOT EXISTS mykeyspace WITH replication = {'class': 'NetworkTopologyStrategy', 'datacenter1': 1}"""
)
session.set_keyspace('mykeyspace')
session.execute(
"""CREATE TABLE IF NOT EXISTS users (id UUID PRIMARY KEY, name text, email text)"""
)
# Example: Insert data
user_id = session.execute("SELECT uuid() FROM system.local").one()[0]
session.execute(
"""INSERT INTO users (id, name, email) VALUES (%s, %s, %s)""",
(user_id, "Alice", "alice@example.com")
)
print(f"Inserted user: {user_id}")
# Example: Select data
rows = session.execute("SELECT id, name, email FROM users WHERE id = %s", (user_id,))
for row in rows:
print(f"Retrieved user: {row.id}, {row.name}, {row.email}")
finally:
if session:
session.shutdown()
if cluster:
cluster.shutdown()
Debug
Known issues
breakingPython 3.8 and 3.9 are no longer officially supported by the driver as of recent versions (e.g., 3.29.5 dropped Python 3.9, 3.29.4 dropped Python 3.8). While PyPI metadata indicates `>=3.9`, the official documentation states support for Python 3.10-3.14.fixUpgrade your Python environment to 3.10 or newer for full compatibility and support.
affects: >=3.29.4
breakingSupport for Cassandra native protocol versions 1 and 2 has been removed. Connections to very old ScyllaDB or Apache Cassandra clusters that only support these protocols will fail.fixEnsure your ScyllaDB or Cassandra cluster supports native protocol version 3 or higher. Most modern deployments will already meet this requirement.
affects: >=3.29.4
gotchaThe driver's build system has moved from `setup_requires` to PEP 517. While this improves modern Python packaging, it might affect users with custom or older build environments if they were relying on `setup_requires` behavior.fixIf encountering build issues, ensure your `pip` is up-to-date and your environment correctly handles PEP 517 builds. Avoid using `--no-build-isolation` if you are not managing build dependencies manually.
affects: >=3.29.9
gotchaThe default event loop in Python versions prior to 3.12 utilized `asyncore`. With `asyncore` being removed entirely in Python 3.12, users must explicitly configure an alternative event loop like `libev`, `gevent`, or `eventlet` when running on Python 3.12+ if they relied on the default.fixFor Python 3.12 and later, explicitly configure a supported event loop for the driver, e.g., by installing `libev` (`pip install pyuv`) or `gevent` (`pip install gevent`) and configuring the cluster to use it.
affects: >=3.29.0 (for Python 3.12+ users)
deprecatedThe `Session.default_consistency_level` attribute is deprecated. Relying on this attribute may lead to future compatibility issues.fixInstead of `Session.default_consistency_level`, specify the consistency level per statement or through Execution Profiles for better control and future compatibility.
affects: >=3.29.8
Upgrade
Version history
3.29.11latest on PyPI · released Jun 15, 2026
Audit
Dependencies
geometrequiredUsed for DSE geo types support, a dependency after the core and DSE drivers were merged.
pyyamlrequiredA core dependency listed in pyproject.toml.
gremlinpythonoptionalOptional dependency for the fluent graph API.
cryptographyoptionalOptional dependency for 'cle' features.
lz4optionalOptional dependency for LZ4 compression support.
python-snappyoptionalOptional dependency for Snappy compression support.
kerberosoptionalOptional dependency for Kerberos authentication (non-Windows).
winkerberosoptionalOptional dependency for Kerberos authentication (Windows).