【发布时间】:2015-06-12 08:28:20
【问题描述】:
我正在尝试使用python driver for cassandra 但是当我在 python shell 中运行这三行时
from cassandra.cluster import Cluster
cluster = Cluster()
session = cluster.connect('demo')
我收到此错误
cassandra.InvalidRequest: code=2200 [Invalid query] message="Keyspace 'demo' does not exist"
pip freeze 说cassandra-driver==2.5.0
我检查了 cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 2.1.4 | CQL spec 3.2.0 | Native protocol v3]
Use HELP for help.
cqlsh> describe keyspaces
system_traces system
cqlsh>
没有名为“演示”的键空间,但我只是按照这两个教程进行操作,他们没有说任何关于预创建键空间的内容 http://planetcassandra.org/getting-started-with-cassandra-and-python/ http://datastax.github.io/python-driver/getting_started.html
【问题讨论】:
标签: python cassandra cassandra-2.0