【发布时间】:2021-02-22 06:12:33
【问题描述】:
我正在尝试在我的计算机上使用 Cassandra。我做了什么:
! pip install cassandra-driver
成功安装cassandra-driver-3.24.0 geomet-0.2.1.post1
import Cassandra
创建与数据库的连接
然后是连接数据库
from cassandra.cluster import Cluster
try:
cluster = Cluster(['127.0.0.1'])
session = cluster.connect()
except Exception as e:
print(e)
有一个错误:
('Unable to connect to any servers', {'127.0.0.1:9042': ConnectionRefusedError(10061, "Tried connecting to [('127.0.0.1', 9042)]. Last error: No connection could be made because the target machine actively refused it")})
我想知道是否存在配置问题,然后我检查以下内容: Java_Hone 的用户变量如下:
Cassandra 安装在这里:
C:\Users\xx\anaconda3\Lib\site-packages
site-packages 下有两个包:
我已经检查了很多答案,但找不到解决方案。我不熟悉配置。有人可以帮忙吗? 谢谢。
【问题讨论】:
标签: python cassandra jupyter-notebook