ImportError: No module named social_django.middleware - django

Hello I'm new to python and Django. Currently I'm trying to run a project made in django 1.10.2 and python 2.7 in ubuntu 16.04. The project uses a module called python-social-auth and when I try to run the project I get the following error:
python manage.py runserver
Unhandled exception in thread started by <function wrapper at 0x7fb7d118a758>
Traceback (most recent call last):
File "/home/mauricio/.local/lib/python2.7/site-packages/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/home/mauricio/.local/lib/python2.7/site-packages/channels/management/commands/runserver.py", line 39, in inner_run
http_consumer=self.get_consumer(*args, **options),
File "/home/mauricio/.local/lib/python2.7/site-packages/channels/management/commands/runserver.py", line 134, in get_consumer
return StaticFilesConsumer()
File "/home/mauricio/.local/lib/python2.7/site-packages/channels/handler.py", line 327, in _init_
self.handler = self.handler_class()
File "/home/mauricio/.local/lib/python2.7/site-packages/channels/staticfiles.py", line 18, in _init_
super(StaticFilesHandler, self).__init__()
File "/home/mauricio/.local/lib/python2.7/site-packages/channels/handler.py", line 177, in _init_
self.load_middleware()
File "/home/mauricio/.local/lib/python2.7/site-packages/django/core/handlers/base.py", line 80, in load_middleware
middleware = import_string(middleware_path)
File "/home/mauricio/.local/lib/python2.7/site-packages/django/utils/module_loading.py", line 20, in import_string
module = import_module(module_path)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named social_django.middleware
being that I already have the python-social-auth module installed.
Hopefully you can help me in detail to solve this problem because as I told you I am new to using these tools.

Related

Django project cannot find webpack_loader

I'm trying to run this project https://github.com/v1k45/ponynote But I get an error when running the api. I run it with python 3.6 as the latest python will not run django 1.11.
$ python manage.py runserver
Unhandled exception in thread started by <function wrapper at 0x103b5b500>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
autoreload.raise_last_exception()
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(*_exception)
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/local/Cellar/python#2/2.7.15_1/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named webpack_loader
Any idea what the problem is?
the error mentions python 2.7. Turns out I had not set the python version correctly in pipenv. Solution
pipenv install -r requirements.txt --python 3.6.6

No module named 'endless_pagination'

I'm trying to setup endless_pagination, I've followed the documentation but getting an error:
Traceback (most recent call last):
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
File "/bin/user_wsgi_wrapper.py", line 154, in __call__
app_iterator = self.app(environ, start_response)
File "/bin/user_wsgi_wrapper.py", line 170, in import_error_application
raise e
File "/bin/user_wsgi_wrapper.py", line 179, in <module>
application = load_wsgi_application()
File "/bin/user_wsgi_wrapper.py", line 175, in load_wsgi_application
return __import__(os.environ['WSGI_MODULE'], globals(), locals(), ['application']).application
File "/var/www/khalid_pythonanywhere_com_wsgi.py", line 25, in <module>
application = get_wsgi_application()
File "/usr/local/lib/python3.5/dist-packages/django/core/wsgi.py", line 13, in get_wsgi_application
django.setup()
File "/usr/local/lib/python3.5/dist-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python3.5/dist-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python3.5/dist-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ImportError: No module named 'endless_pagination'
I installed it using easy_install -Z django-endless-pagination, and added 'django.core.context_processors.request' in the Settings.py context_processors (under TEMPLATES).
I added 'endless_pagination' in the installed apps section of the Settings.py. These are the steps from the documentation, when I reload the server, I get ImportError: No module named 'endless_pagination'. What seems to be the problem here?
Any help/direction would be appreciated,
Thanks
INSTALLATION OUTPUT:
(myvenv) 08:19 ~/mysite $ easy_install -Z django-endless-pagination
Searching for django-endless-pagination
Reading https://pypi.python.org/simple/django-endless-pagination/
Downloading https://pypi.python.org/packages/6e/82/27bac7a83a5aedb45d031edb5a0ce2f0f9c57b81254e4e162a6bbd94acfa/django-
endless-pagination-2.0.tar.gz#md5=8efa40cee51ebe229ce15ed258594ba0
Best match: django-endless-pagination 2.0
Processing django-endless-pagination-2.0.tar.gz
Writing /tmp/easy_install-lsvk24ce/django-endless-pagination-2.0/setup.cfg
Running django-endless-pagination-2.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-lsvk24ce/django-endless-pagina
tion-2.0/egg-dist-tmp-3qtpwgoa
zip_safe flag not set; analyzing archive contents...
creating /home/khalid/mysite/myvenv/lib/python3.5/site-packages/django_endless_pagination-2.0-py3.5.egg
Extracting django_endless_pagination-2.0-py3.5.egg to /home/khalid/mysite/myvenv/lib/python3.5/site-packages
Adding django-endless-pagination 2.0 to easy-install.pth file
Installed /home/khalid/mysite/myvenv/lib/python3.5/site-packages/django_endless_pagination-2.0-py3.5.egg
Processing dependencies for django-endless-pagination
Finished processing dependencies for django-endless-pagination
if you are using Django 1.8 or newer, you must use this one: http://django-el-pagination.readthedocs.io/en/latest/start.html (EL Pagination), endless paginations is deprecated in Django 1.8 and newers

ImportError: No module named encrypted_fields - Do I need to install django-encrypted-fields in settings.py? If so, how?

I followed the instructions on https://github.com/defrex/django-encrypted-fields but importing still doesn't work.
I tried adding encrypted_fields/django_encrypted_fields/django-encrypted-fields to INSTALLED_APPS in settings.py but none of those work.
How can I fix this?
Thanks!
Thanks to #Alasdair for the tip:
I installed django-encrypted-fields in the wrong virtualenv. Uninstalled it, installed it in the correct one and it imports.
However, now I'm having the same issue with keyczar, which I re-installed with django-encrypted-fields into the right virtualenv. Here is the full traceback:
Unhandled exception in thread started by <function wrapper at 0x7fee03e112a8>
Traceback (most recent call last):
File "/home/hsvar/.virtualenvs/djangodev/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/hsvar/.virtualenvs/djangodev/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/home/hsvar/.virtualenvs/djangodev/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(*_exception)
File "/home/hsvar/.virtualenvs/djangodev/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/home/hsvar/.virtualenvs/djangodev/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/hsvar/.virtualenvs/djangodev/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/home/hsvar/.virtualenvs/djangodev/local/lib/python2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named keyczar

Django developement server module is not installed but is

I'm try run development server byt I recive error like this:
Unhandled exception in thread started by <function wrapper at 0x807ad8848>
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 107, in inner_run
autoreload.raise_last_exception()
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 252, in raise_last_exception
six.reraise(*_exception)
File "/usr/local/lib/python2.7/site-packages/django/utils/autoreload.py", line 229, in wrapper
fn(*args, **kwargs)
File "/usr/local/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/lib/python2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/local/lib/python2.7/site-packages/django/apps/config.py", line 86, in create
module = import_module(entry)
File "/usr/local/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named avatar
I'm using virtualenv and I actived it and project using it and I installed django-avatar there.
django-avatar
On my local server this module work normally :)
You have some idea what is wrong?
I solved my problem using absolute path to python in my enviroment that resolve it. And add after that manage.py.
/usr/home/login/virtualenvs/env_name/bin/python passenger_wsgi.py
/usr/home/login/virtualenvs/env_name/bin/python manage.py

my Django app has broken for some reason getting anerror message

I was cleaning out some of the unused projects on my computer and when I tried to use my latest project I get this error message
Unhandled exception in thread started by <function wrapper at 0x107b01d70>
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
autoreload.raise_last_exception()
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
six.reraise(*_exception)
File "/Library/Python/2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
fn(*args, **kwargs)
File "/Library/Python/2.7/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Library/Python/2.7/site-packages/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/Library/Python/2.7/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named crispy_forms
is this even fixable. This is a lot of work and hours for me so I hope it is
ImportError: No module named crispy_forms
pip install --upgrade django-crispy-forms
Add crispy_forms to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = (
...
'crispy_forms',
)