简体   繁体   English

无法使用Python连接rethinkdb

[英]Unable to connect rethinkdb using Python

I am trying to connect with Rethinkdb using Python. 我正在尝试使用Python与Rethinkdb连接。 I sucessfully installed rethinkdb using pip install rethinkdb on ubuntu. 我在ubuntu上使用pip install rethinkdb成功安装了rethinkdb。 but I try to connect rethinkdb using python as follows: 但我尝试使用python连接rethinkdb,如下所示:

import rethinkdb as r
conn=r.connect().repl()

I am getting the following error on connection: 连接时出现以下错误:

ethinkdb.errors.ReqlDriverError: Could not connect to localhost:28015. Error: [Errno 111] Connection refused

In another post I found that this issue arises if we have different rethinkdb driver version and server version. 另一篇文章中,我发现如果我们的rethinkdb驱动程序版本和服务器版本不同,则会出现此问题。 I am able to find rethinkdb version using 我可以使用找到rethinkdb版本

pip freeze 

It gives following: 它给出以下内容:

backports-abc==0.5
backports.shutil-get-terminal-size==1.0.0
bleach==2.1.2
boto==2.38.0
cassandra-driver==3.12.0
certifi==2017.11.5
chardet==2.3.0
click==6.7
configparser==3.5.0
cryptography==1.2.3
decorator==4.1.2
duplicity==0.7.6
entrypoints==0.2.3
enum34==1.1.2
Flask==0.12.2
functools32==3.2.3.post2
futures==3.2.0
html5lib==1.0.1
idna==2.0
ipaddress==1.0.16
ipykernel==4.7.0
ipython==5.5.0
ipython-genutils==0.2.0
ipywidgets==7.0.5
itsdangerous==0.24
Jinja2==2.10
jsonschema==2.6.0
jupyter==1.0.0
jupyter-client==5.2.0
jupyter-console==5.2.0
jupyter-core==4.4.0
lockfile==0.12.2
MarkupSafe==1.0
mistune==0.8.3
nbconvert==5.3.1
nbformat==4.4.0
ndg-httpsclient==0.4.0
notebook==5.2.2
pandocfilters==1.4.2
pathlib2==2.3.0
pexpect==4.3.1
pickleshare==0.7.4
prompt-toolkit==1.0.15
ptyprocess==0.5.2
pyasn1==0.1.9
Pygments==2.2.0
pygobject==3.20.0
pyOpenSSL==0.15.1
python-cloudfiles==1.7.10
python-dateutil==2.6.1
pyxdg==0.25
pyzmq==16.0.3
qtconsole==4.3.1
requests==2.9.1
rethinkdb==2.3.0.post6
scandir==1.6
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.10.0
terminado==0.8.1
testpath==0.3.1
tornado==4.5.2
traitlets==4.3.2
urllib3==1.13.1
wcwidth==0.1.7
webencodings==0.5.1
Werkzeug==0.12.2
widgetsnbextension==3.0.8

Rethinkdb version is there, But I don't know how to check server version. Rethinkdb版本在那里,但是我不知道如何检查服务器版本。 Please help me with this. 请帮我解决一下这个。

After starting virtualenv, when I tried to start rethinkdb it gives error. 启动virtualenv之后,当我尝试启动rethinkdb时,出现错误。 As in following screenshot. 如以下屏幕截图所示。 屏幕截图

Is your server running?. 您的服务器正在运行吗? Can you show the result of the executing the following command in the terminal?. 您可以在终端中显示执行以下命令的结果吗?

ps aux | grep rethinkdb

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM