简体   繁体   English

从 django.allauth.account.adapter 导入 DefaultAccountAdapter ModuleNotFoundError:没有名为“django.allauth”的模块

[英]from django.allauth.account.adapter import DefaultAccountAdapter ModuleNotFoundError: No module named 'django.allauth'

I have installed django-allauth with docker-compose exec web pipenv install django-allauth , but I recieve an erro from django.allauth.account.adapter import DefaultAccountAdapter ModuleNotFoundError: No module named 'django.allauth' , when I use docker-compose exec web python manage.py makemigrations . I have installed django-allauth with docker-compose exec web pipenv install django-allauth , but I recieve an erro from django.allauth.account.adapter import DefaultAccountAdapter ModuleNotFoundError: No module named 'django.allauth' , when I use docker-compose exec web python manage.py makemigrations Thaks for your help:)谢谢你的帮助:)

In your code you should replace from django.allauth.account.adapter import DefaultAccountAdapter with from allauth.account.adapter import DefaultAccountAdapter在您的代码中,您应该将from django.allauth.account.adapter import DefaultAccountAdapter替换为from allauth.account.adapter import DefaultAccountAdapter

django.allauth means that you are looking for module allauth inside Django. django.allauth 表示您正在 Django 中寻找模块allauth But allauth is an independent Python module inside Python site-packages.allauth是 Python 站点包内的独立 Python 模块。 So just call it without Django.所以只需在没有Django. prepended.前置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM