dola
dola

Reputation: 1

AttributeError: module 'rethinkdb' has no attribute 'connect'

I am using the RethinkDB in my Jupyter Python Notebook. I have installed the RethinkDB server for my Windows setup. And server version is

C:\Users\rethinkdb-2.3.6>rethinkdb --version
rethinkdb 2.3.6-windows (MSC 190024215)

On the client side, I see the rethinkDB is : rethinkdb==2.4.2.post1. So when use my python code to connect to the DB which i have already started on my windows server, it gives the error as:

=>self.conn = r.connect('localhost', 28015)
AttributeError: module 'rethinkdb' has no attribute 'connect'

I have seen some earlier posts where there are comments that the way we connect to RethinkDB has changed from 2.4.X and I already tried the code options below but they did not help:

import rethinkdb as rdb
r = rdb.RethinkDB()
self.conn = r.connect('localhost', 28015)

Upvotes: 0

Views: 423

Answers (1)

Dushan
Dushan

Reputation: 1565

try this,

from rethinkdb import RethinkDB 
r = RethinkDB()

then try connecting it like this,

r.connect( "localhost", 28015).repl()

Upvotes: 0

Related Questions