gpt4 book ai didi

python - 在聊天信使中连接到 redis-server 时出错

转载 作者:IT王子 更新时间:2023-10-29 06:10:13 26 4
gpt4 key购买 nike

我用Python开发了一个聊天系统。使用的库:easygui、pycrypto、netifaces、stepic、redis、rabbitmq、pika、PIL 和 setuptools。所有库似乎都安装良好,请引用:python> import library通过在 localhost 上使用 redis-server,用户可以连接到 redis 并注册、登录、聊天,..但是当在不同的设备上设置 redis 并在代码中将 localhost 更改为 redis 服务器 ip 时,我收到以下错误。 (我在 oracle 虚拟机中使用 lubuntu 最新版本)

enter code here
Traceback (most recent call last):
File "kiducb.py", line 392, in <module>
g = Gui()
File "kiducb.py", line 19, in __init__
self.welcome()
File "kiducb.py", line 33, in welcome
rl = self.login()
File "kiducb.py", line 126, in login
resp = self.check_up(fvals[0], fvals[1], mac)
File "kiducb.py", line 76, in check_up
val = self.re.get(username)
File "/usr/lib/python2.7/dist-packages/redis/client.py", line 423, in get
return self.execute_command('GET', name)
File "/usr/lib/python2.7/dist-packages/redis/client.py", line 283, in execute_command
connection.send_command(*args)
File "/usr/lib/python2.7/dist-packages/redis/connection.py", line 260, in send_command
self.send_packed_command(self.pack_command(*args))
File "/usr/lib/python2.7/dist-packages/redis/connection.py", line 243, in
send_packed_command
self.connect()
File "/usr/lib/python2.7/dist-packages/redis/connection.py", line 191, in connect
raise ConnectionError(self._error_message(e))
redis.exceptions.ConnectionError: Error 111 connecting 10.1.1.12:6379. Connection refused.

最佳答案

为了解决这个问题,我从系统中删除了之前使用apt-get安装的redis-server,然后我遵循了这个链接指令:https://www.digitalocean.com/community/articles/how-to-install-and-use-redis

关于python - 在聊天信使中连接到 redis-server 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19451771/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com