ImportError: No module named redis_cache
Asked Answered
G

5

7

I am using Django=1.5.4 and I have installed redis properly in ubuntu. I installed django-redis. But I get this error. I put 'redis_cache' in my django settings. But I got this error

ImportError: No module named redis_cache

What to do?

Greenhouse answered 27/3, 2016 at 18:55 Comment(1)
whats's the output of python2 -c "import redis_cache"Same
B
11

You are supposed to add django_redis instead of redis_cache.

The documentation says:

if you are coming from django-redis < 3.8.x, you are probably using redis_cache. Since django-redis 3.8.x, redis_cache module is deprecated in favor to django_redis. The redis_cache module will be removed in 3.9.x versions.

Ballerina answered 27/3, 2016 at 19:20 Comment(0)
T
8

Redis cache backend for Django

Run python setup.py install to install, or place django_redis on your Python path.

You can also install it with: pip install django-redis

Tiphane answered 6/7, 2016 at 7:8 Comment(1)
Thanks! It works for me on python 3.6 and django 1.11Toxinantitoxin
B
1

Use following command as available at this:

pip install redis-simple-cache
Bercy answered 29/4, 2016 at 18:57 Comment(0)
S
0

you are missing django_redis module run below command to add the module:

pip install django-redis
Swedenborgianism answered 27/2, 2022 at 4:23 Comment(0)
G
0

I was using docker compose + poetry to manage dependencies, and the solution for me to get rid of this Redis error was:

  • On Docker, delete all images and containers associated with the project
  • On VSCode, run the command Python: Clear cache and reload windows
  • Run docker compose up again

It seems like it was a cache issue, at least in my case.

Maybe there's a more surgical way of doing this, but these steps certainly are helpful when you've already double checked all dependencies and project settings.

Gecko answered 6/3, 2023 at 12:3 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.