cannot import name 'StrictRedis' from 'redis'

【cannot import name 'StrictRedis' from 'redis'】Long story short
cannot import name 'StrictRedis' from 'redis'
文章图片

-----------------------------------------------图一
库一切安装的都很正常。可是出现如下情况。
cannot import name 'StrictRedis' from 'redis'
文章图片

------------------------------------------------------图二
查资料后,修改文件名即可。原因是把库名设置成了redis。修改成redis_就好了。导入会先从本地寻找。
cannot import name 'StrictRedis' from 'redis'
文章图片

---------------------------------------------图三
cannot import name 'StrictRedis' from 'redis'
文章图片

----------------------------------图四
参考文章
[1]https://github.com/andymccurdy/redis-py/issues/533

    推荐阅读