解决方法:在使用StrictRedis链接数据库时添加参数decode_responses=True,代码如下:StrictRedis(host='localhost',port=6379,db=0,password=None,decode_responses=True)