Setup error for six package of django.utils
TareqMonwer opened this issue · 2 comments
I was following along the docs (https://django-base-site.readthedocs.io/en/latest/setup-and-usage.html) and I got this long error which is occured for django.utils.six while running migrate command.
Here is the error log:
django.core.cache.backends.base.InvalidCacheBackendError: Could not find backend 'redis_cache.RedisCache': cannot import name 'six' from 'django.utils' (/home/tareq/.local/share/virtualenvs/example-Y5_gWTrw/lib/python3.9/site-packages/django/utils/__init__.py)
Python: 3.9
OS: Manjaro
Am I missing any config or anything else?
Complete Error Log:
Traceback (most recent call last):
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/core/cache/__init__.py", line 39, in create_connection
backend_cls = import_string(backend)
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/utils/module_loading.py", line 17, in import_string
module = import_module(module_path)
File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/redis_cache/__init__.py", line 1, in <module>
from redis_cache.backends.single import RedisCache
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/redis_cache/backends/single.py", line 9, in <module>
from redis_cache.backends.base import BaseRedisCache
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/redis_cache/backends/base.py", line 18, in <module>
from redis_cache.utils import get_servers, parse_connection_kwargs, import_class
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/redis_cache/utils.py", line 5, in <module>
from django.utils import six
ImportError: cannot import name 'six' from 'django.utils' (/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/utils/__init__.py)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/tareq/code/explore-dj/wow_djbase/manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 79, in execute
return super().execute(*args, **options)
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/core/management/base.py", line 393, in execute
self.check()
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/core/management/base.py", line 419, in check
all_issues = checks.run_checks(
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/core/checks/registry.py", line 76, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/core/checks/caches.py", line 63, in check_file_based_cache_is_absolute
cache = caches[alias]
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/utils/connection.py", line 62, in __getitem__
conn = self.create_connection(alias)
File "/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/core/cache/__init__.py", line 41, in create_connection
raise InvalidCacheBackendError(
django.core.cache.backends.base.InvalidCacheBackendError: Could not find backend 'redis_cache.RedisCache': cannot import name 'six' from 'django.utils' (/home/tareq/.local/share/virtualenvs/wow_djbase-YT6snu27/lib/python3.9/site-packages/django/utils/__init__.py)
Hi @TareqMonwer,
Thank you for pointing this out. I started looking a little bit this morning, but I'm going to have to move on to some other things at the moment. That documentation is a little behind, especially now that I use Docker exclusively. I also checked out a fresh docker setup using the Quickstart method in the readme and it had the same issue. So this is something that will need to be fixed and I'll look into it soon.
I've pushed up several commits on master and also made a couple of tweaks to the manual install documentation.