redis.exceptions.DataError: Invalid input of type: ‘dict‘. Convert to a byte, string or number first

Love The Way You Lie 2023-10-03 19:52 87阅读 0赞

#

目录

一、项目场景

二、问题描述

三、解决方案


一、项目场景

利用python往redis写数据,报错。


二、问题描述

redis.exceptions.DataError: Invalid input of type: ‘dict’. Convert to a byte, string or number first.


三、解决方案

查看当前redis版本

  1. pip freeze

16db27ca6c594b229844c3a19c4cf1e3.png 可以看到,当前版本是4.3.4。

#

对redis进行降级处理,可以解决这个问题。将当前版本降级到2.10.6

  1. pip install -U redis==2.10.6

发表评论

表情:
评论列表 (有 0 条评论,87人围观)

还没有评论,来说两句吧...

相关阅读