Rethinkdb and python driver-unable to connect

荒凉一梦 提交于 2020-01-14 03:06:13

问题


Im having a problem with connecting to my RethinkDB local host using my python driver. The directory structure is:

home/rethinkdb/drivers/python.

When Im inside this python directory I start the python shell. I type import rethinkdb as r r.connect('localhost', 28015).repl()

I get the error:

    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "rethinkdb/net.py", line 366, in connect
        return Connection(host, port, db, auth_key, timeout)
  File "rethinkdb/net.py", line 136, in __init__
    self.reconnect(noreply_wait=False)
  File "rethinkdb/net.py", line 157, in reconnect
    self._sock_sendall(struct.pack("<L", p.VersionDummy.Protocol.JSON))
  File "rethinkdb/net.py", line 219, in _sock_sendall
    return self.socket.sendall(data)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
**socket.error: [Errno 32] Broken pipe**

I have no idea why this occurs-Help appreciated!


回答1:


Try this to connect:

r.connect(host="localhost", port=28015).repl()

And make sure that the server and the driver has a matching version (at least the first two numbers).

rethinkdb --version
pip freeze | grep rethinkdb

If they don't, update the server/driver.



来源:https://stackoverflow.com/questions/27209185/rethinkdb-and-python-driver-unable-to-connect

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!