django - python-social-auth 与 Django : ImportError: No module named 'social_django'

标签 django python-3.x python-social-auth

已安装所有软件包!!
嗨,我正在使用 python 3.5 Django==1.10 我安装了 Python-social-auth 执行命令 Python manage.py transfer error received !

Traceback (most recent call last):
File "manage.py", line 22, in 
execute_from_command_line(sys.argv)
File "/home/berluskuni/web_project/exprender/.exprender/lib64/python3.5/site-packages/django
/core/management/init.py", line 367, in execute_from_command_line
utility.execute()
File "/home/berluskuni/web_project/exprender/.exprender/lib64/python3.5/site-packages/django/core/management/init.py", line 341, in execute
django.setup()
File "/home/berluskuni/web_project/exprender/.exprender/lib64/python3.5/site-packages/django/init.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/berluskuni/web_project/exprender/.exprender/lib64/python3.5/site-packages/django/apps/registry.py", line 108, in populate
app_config.import_models(all_models)
File "/home/berluskuni/web_project/exprender/.exprender/lib64/python3.5/site-packages/django/apps/config.py", line 199, in import_models
self.models_module = import_module(models_module_name)
File "/usr/lib64/python3.5/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 986, in _gcd_import
File "", line 969, in _find_and_load
File "", line 958, in _find_and_load_unlocked
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "/home/berluskuni/web_project/exprender/.exprender/lib64/python3.5/site-packages/social/apps/django_app/default/models.py", line 1, in 
from social_django.models import AbstractUserSocialAuth, UserSocialAuth, Nonce, Association, Code, DjangoStorage
ImportError: No module named 'social_django'

最佳答案

要将 Django 与 python social auth 一起使用,您还需要安装 Django 应用程序。

您可以在安装 python-social-auth 时指定要安装 Django 的额外要求:

pip install python-social-auth[django]

或者,在这种情况下,您可以单独安装缺少的软件包:
pip install social-auth-app-django

关于django - python-social-auth 与 Django : ImportError: No module named 'social_django' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41635052/

相关文章:

python-3.x - 完成训练过程后如何获得模型的训练精度?

python - 使用 pytesseract 执行 OCR 时出错

Django 中的 Python 社交身份验证,makemigrations 未检测到任何更改

django - 在 Django 模板中使用来自 python-social-auth 的 extra_data

django - 403 错误,因为 `id_token` 在 Django + python-social-app 中被用作 `access_token`

python - 激活阿拉伯语翻译后,Django 表单占位符和标签未翻译

css - Django + 管道压缩 css : 404 for the output_filename css file

python - 将局部变量转换为全局变量

python - Django 1.7 makemigrations - ValueError : Cannot serialize class

python - Django 二进制或 BLOB 模型字段