答案 0 :(得分:0)
也许你可以试试这个包吗?
这个软件包来自DataStax,它是python的Cassandra驱动程序。
Github上: https://github.com/datastax/python-driver
API文件: https://datastax.github.io/python-driver/api/cassandra/cluster.html
from cassandra.cluster import Cluster
cluster = Cluster(['your_cassandra_ip'])
session = cluster.connect()
session.execute('CREATE KEYSPACE IF NOT EXISTS mykeyspace WITH REPLICATION = { 'class' : 'SimpleStrategy', 'replication_factor' : 3 };')