omab / python-social-auth

Social auth made simple
http://psa.matiasaguirre.net
BSD 3-Clause "New" or "Revised" License
2.83k stars 1.09k forks source link

No module named 'social_django'/'social' #1082

Closed esutoru closed 7 years ago

esutoru commented 7 years ago

Hello. I installed social-auth-app-django, but if I try to run migrate, I get following error message: Traceback (most recent call last): File "manage.py", line 10, in <module> execute_from_command_line(sys.argv) File "C:\Python34\lib\site-packages\django\core\management\__init__.py", line 353, in execute_from_command_line utility.execute() File "C:\Python34\lib\site-packages\django\core\management\__init__.py", line 327, in execute django.setup() File "C:\Python34\lib\site-packages\django\__init__.py", line 18, in setup apps.populate(settings.INSTALLED_APPS) File "C:\Python34\lib\site-packages\django\apps\registry.py", line 85, in populate app_config = AppConfig.create(entry) File "C:\Python34\lib\site-packages\django\apps\config.py", line 90, in create module = import_module(entry) File "C:\Python34\lib\importlib\__init__.py", line 109, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 2254, in _gcd_import File "<frozen importlib._bootstrap>", line 2237, in _find_and_load File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked ImportError: No module named 'social_django'

If I use python-social-auth, I get following the same error message: ImportError: No module named 'social'

berluskuni commented 7 years ago

Hi, I'm using python 3.5 Django==1.10 I installed Python-social-auth executed the command Python manage.py transfer error received! python manage.py migrate 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' (.exprender) [*****@localhost exprender]$

berluskuni commented 7 years ago

I helped the decision! pip install python-social-auth[django] or pip install social-auth-app-django and in INSTALLED APPS ..... ..... 'social_django', 'social.apps.django_app.default', Good luck

jpic commented 7 years ago

See:

https://github.com/omab/python-social-auth/blob/master/MIGRATING_TO_SOCIAL.md

esutoru commented 7 years ago

I solved my problem. It was because virtual environment. I forgot active it

rifa84 commented 7 years ago

I have the same problem, and virtualenv is active, but the same error "No module named social_djano"

amrhassab commented 3 years ago

I solved my problem. It was because virtual environment. I forgot active it

Also dont forget to enter shell before installing for example run 'pipenv shell'