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
Related
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.
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
I am solving this for quite a long time already.
I print like this.
python2.7 -c "import sys; print sys.path"
And I saw my module directly there.
['', '/home/khantthulinn/lib/python2.7/pip-8.1.2-py2.7.egg',
'/home/khantthulinn/lib/python2.7',
'/home/khantthulinn/lib/python2.7', '/usr/lib64/python27.zip',
'/usr/lib64/python2.7', '/usr/lib64/python2.7/plat-linux2',
'/usr/lib64/python2.7/lib-tk', '/usr/lib64/python2.7/lib-old',
'/usr/lib64/python2.7/lib-dynload',
'/home/khantthulinn/.local/lib/python2.7/site-packages',
'/usr/lib64/python2.7/site-packages',
'/usr/lib64/python2.7/site-packages/PIL',
'/usr/lib64/python2.7/site-packages/geos',
'/usr/lib/python2.7/site-packages']
But I always get this error. How shall I solve?
Unhandled exception in thread started by Traceback (most recent call last): File
"/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/utils/autoreload.py",
line 229, in wrapper
fn(*args, **kwargs) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/core/management/commands/runserver.py",
line 107, in inner_run
autoreload.raise_last_exception() File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/utils/autoreload.py",
line 252, in raise_last_exception
six.reraise(*_exception) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/utils/autoreload.py",
line 229, in wrapper
fn(*args, **kwargs) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/init.py",
line 18, in setup
apps.populate(settings.INSTALLED_APPS) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/apps/registry.py",
line 85, in populate
app_config = AppConfig.create(entry) File "/home/khantthulinn/webapps/mmspeaker/lib/python2.7/Django-1.8.14-py2.7.egg/django/apps/config.py",
line 86, in create
module = import_module(entry) File "/usr/lib64/python2.7/importlib/init.py", line 37, in
import_module
import(name) ImportError: No module named push_notifications
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
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',
)