使用redis包过程中出现如下问题:

Traceback (most recent call last):
File "Check_UaPool.py", line 92, in <module>
r.srem(REDIS_KEY,IP)
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/client.py", line 1940, in srem
return self.execute_command('SREM', name, *values)
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/client.py", line 774, in execute_command
connection.send_command(*args)
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/connection.py", line 619, in send_command
self.send_packed_command(self.pack_command(*args))
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/connection.py", line 659, in pack_command
for arg in imap(self.encoder.encode, args):
File "/root/.pyenv/versions/3.6.5/lib/python3.6/site-packages/redis/connection.py", line 124, in encode
"byte, string or number first." % typename)
redis.exceptions.DataError: Invalid input of type: 'dict'. Convert to a byte, string or number first.
原因:python中redis包更新导致的问题,变更了srem方法的输入。

解决方法:

pip install redis==2.10.6
问题得到解决。

原文:https://blog.csdn.net/weixin_39128119/article/details/87373091

相关文章:

  • 2022-12-23
  • 2021-07-06
  • 2021-06-27
  • 2021-12-24
  • 2021-11-28
  • 2022-12-23
  • 2021-06-23
  • 2021-06-26
猜你喜欢
  • 2021-08-08
  • 2021-12-29
  • 2021-09-07
  • 2021-09-26
  • 2021-05-28
  • 2022-12-23
  • 2021-12-02
相关资源
相似解决方案