ModuleNotFoundError: No module named 'django.utils.six.moves'

While deploying my Django 3 code on AWS EC2 server I'm getting the error below. I uninstalled six many times and deleted the cache folder and installed different versions of six but none of them are working.

May 22 17:06:33 ip-172-31-7-56 gunicorn[73506]:     from storages.backends.s3boto3 import S3Boto3Storage
May 22 17:06:33 ip-172-31-7-56 gunicorn[73506]:   File "/home/ubuntu/lighthousemedia/.venv/lib/python3.12/site-packages/storages/backends/s3boto3.py", line 12>
May 22 17:06:33 ip-172-31-7-56 gunicorn[73506]:     from django.utils.six.moves.urllib import parse as urlparse
May 22 17:06:33 ip-172-31-7-56 gunicorn[73506]: ModuleNotFoundError: No module named 'django.utils.six.moves'

Borrowing from an answer here, six support was dropped in Django 3.

Seeing as you claim to already have attempted to uninstall six and it still did not work (though you also say you have attempted to reinstall it), the problem might be that you are using packages which still depends on six. You can try to remove those packages or upgrade them if they have since removed their dependencies on six.

Back to Top