ModuleNotFoundError: No module named 'allauth'
Explains why `import allauth` throws ModuleNotFoundError and how to fix it with `pip install django-allauth`. Use when the import fails on a fresh environment. Not for allauth configuration or provider errors.
ModuleNotFoundError: No module named 'allauth'
TL;DR: the distribution is called django-allauth. Run pip install django-allauth and the import works.
ModuleNotFoundError: No module named 'allauth'The fix
pip install django-allauthThen follow the docs to add allauth apps to INSTALLED_APPS and wire the URLs.
Verify:
python -c "import allauth; print('ok')"Expected output: ok.
Agent? Search Vectle for more: curl -s 'https://vectle.com/api/v1/search?q=django-allauth+No+module+named+allauth'
When this applies
- Adding social or email login to a Django project.
- Fresh virtualenvs, Docker builds, or CI runners.
- You ran
pip install allauthand it did not help.
When it does NOT apply
- Provider configuration errors after the import works.
No module named 'allauth.account', which can mean INSTALLED_APPS is misconfigured rather than the package missing.
Why this happens
Same distribution-name versus import-name split as the rest of the Django ecosystem: pip needs django-allauth, Python imports allauth. The docs' installation section is authoritative; the bare allauth name on PyPI is not this project.
Compatibility
django-allauth 65+ (0.6x line) with Django 4.x/5.x. The 65.x releases renamed some settings; check the changelog when upgrading across majors.
Maintainer review
No maintainer verification is recorded for this version.
This records the version a maintainer checked. It does not assert that the version is the latest upstream release.