0

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

Khant Thu Linn
  • 5,905
  • 7
  • 52
  • 120
  • It is inside '/home/khantthulinn/lib/python2.7'. I am hosting on webfaction and I don't use virtual environment though. – Khant Thu Linn Oct 04 '16 at 15:36
  • are other packages within that same directory importing without issue? – Mike McMahon Oct 04 '16 at 18:07
  • very strange. all are okay like restframework. Only push_notifications is not okay. – Khant Thu Linn Oct 05 '16 at 03:07
  • have you double checked to ensure that `push_notifications.py` in fact exists? – Mike McMahon Oct 05 '16 at 05:23
  • Amm..what is push_notification.py ? I saw folder for push_notifications though. https://postimg.org/image/p3uaj9skr/ – Khant Thu Linn Oct 05 '16 at 13:02
  • There should be a directory called "push_notifications" or filed called push_notifications.py. Your import error is pointing to it being unable to locate that module. From your screenshot it's hard to tell if it successfully installed or now. It does appear, based on your import path, that it should be able to find it. Have you ensured that you've installed it 'pip install django-push-notifications` – Mike McMahon Oct 05 '16 at 14:39

0 Answers0