python-social-auth with Django: ImportError: No module named 'social_django'
Asked Answered
S

5

18

ALL packages installed!! Hi, I'm using python 3.5 Django==1.10 I installed Python-social-auth executed the command 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'
Selfesteem answered 13/1, 2017 at 12:49 Comment(0)
P
46

To use Django with python social auth, you need to install the Django app as well.

You can specify that you want to install the extra requirements for Django when you install python-social-auth:

pip install python-social-auth[django]

Or, in this case, you can install the missing package individually:

pip install social-auth-app-django
Pallaton answered 13/1, 2017 at 13:13 Comment(1)
Successfully installed social-auth-app-django-0.1.0, python manage.py migrate, ImportError: No module named 'social_auth'Buffo
S
6

Probably you should use pip 3:

pip3 install social-auth-app-django
Scheld answered 9/3, 2017 at 13:58 Comment(0)
M
4

USE pip install python-social-auth[django] instead of pip install python-social-auth while installing


i have first done install pip install python-social-auth

Run

error: No module named 'social_django'

Then i install

pip install python-social-auth[django]

RUN

Operations to perform: Apply all migrations: admin, auth, contenttypes, music, sessions, social_django Running migrations: Applying social_django.0001_initial... OK Applying social_django.0002_add_related_name... OK Applying social_django.0003_alter_email_max_length... OK Applying social_django.0004_auto_20160423_0400... OK Applying social_django.0005_auto_20160727_2333... OK Applying social_django.0006_partial... OK


Running migrations:

For extra support

Migrating from python-social-auth to split social

enter link description here

Modality answered 6/2, 2017 at 21:15 Comment(0)
P
2

Just run:

pip install social-auth-app-django
Pro answered 14/2, 2023 at 23:9 Comment(0)
F
1

If you are using pipenv like me don't forget to enter the shell and then install (I forgot to do so and it caused similar errors):

pipenv shell
pipenv install python-social-auth-app-django

then add social_django to install apps

I understand this wasn't the original question but hope it helps.

Fiddler answered 14/3, 2021 at 9:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.