Need help with old django: ImportError: No module named app
by maschelsea from LinuxQuestions.org on (#5N7VM)
I'm taking yet another course at Skillshare. Skillshare seems to be a place to dump your programming courses. I doubt the teacher is actually available, otherwise I'd ask her.
My current issue (I suspect) is because I am using old Python (2.7.17) with an old Django (1.11.13) (version provided by the teacher in a download form) I have done what I'm trying to do in this course with other newer versions of Django (Django 2.x) But I'm having enormous difficulty finding any infomation on my particular error. When I took programming in college, it wasn't this hard. Nothing was. But then I didn't use it everyday for ten years. Then for ten years after that I didn't use it at all. It's rather ironic. I'm thinking of redoing my old COBOL final project in python. That is, in Python 3. But that's neither here nor there.
My issue is this:
Code:michael@caitlyn Skeleton Project (django-admin) $ python manage.py runserver
Unhandled exception in thread started by <function wrapper at 0x7efc5297e6d0>
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/core/management/commands/runserver.py", line 116, in inner_run
autoreload.raise_last_exception()
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/utils/autoreload.py", line 251, in raise_last_exception
six.reraise(*_exception)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/apps/config.py", line 120, in create
mod = import_module(mod_path)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
ImportError: No module named appOne of my many Python teachers said that to be taken seriously as a programmer, I need to learn to look up the answers on StackOverflow and other such sites. I looked up this problem on StackOverflow and someone there was having a problem that seemed similar to mine said that I should create a file named app.py in the same directory that __init__.py is in, so I did. It didn't help. There IS no __init__.py. There's __init__pyc and __init__pyo, both of them binary files. With my app.py file, which I made with touch:
Code:root@caitlyn:~# ls /usr/lib64/python2.7/importlib/
__init__.pyc __init__.pyo app.py
root@caitlyn:~# file /usr/lib64/python2.7/importlib/__init__.pyc
/usr/lib64/python2.7/importlib/__init__.pyc: python 2.7 byte-compiled
root@caitlyn:~# file __init__.pyo
__init__.pyo: cannot open `__init__.pyo' (No such file or directory)
root@caitlyn:~# file /usr/lib64/python2.7/importlib/__init__.pyo
/usr/lib64/python2.7/importlib/__init__.pyo: python 2.7 byte-compiled
root@caitlyn:~#Any help with resolving this issue will be appreciated. Thank you in advance for any advice you can offer.
My current issue (I suspect) is because I am using old Python (2.7.17) with an old Django (1.11.13) (version provided by the teacher in a download form) I have done what I'm trying to do in this course with other newer versions of Django (Django 2.x) But I'm having enormous difficulty finding any infomation on my particular error. When I took programming in college, it wasn't this hard. Nothing was. But then I didn't use it everyday for ten years. Then for ten years after that I didn't use it at all. It's rather ironic. I'm thinking of redoing my old COBOL final project in python. That is, in Python 3. But that's neither here nor there.
My issue is this:
Code:michael@caitlyn Skeleton Project (django-admin) $ python manage.py runserver
Unhandled exception in thread started by <function wrapper at 0x7efc5297e6d0>
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/core/management/commands/runserver.py", line 116, in inner_run
autoreload.raise_last_exception()
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/utils/autoreload.py", line 251, in raise_last_exception
six.reraise(*_exception)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/utils/autoreload.py", line 228, in wrapper
fn(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/apps/registry.py", line 85, in populate
app_config = AppConfig.create(entry)
File "/usr/lib64/python2.7/site-packages/Django-1.11.13-py2.7.egg/django/apps/config.py", line 120, in create
mod = import_module(mod_path)
File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
ImportError: No module named appOne of my many Python teachers said that to be taken seriously as a programmer, I need to learn to look up the answers on StackOverflow and other such sites. I looked up this problem on StackOverflow and someone there was having a problem that seemed similar to mine said that I should create a file named app.py in the same directory that __init__.py is in, so I did. It didn't help. There IS no __init__.py. There's __init__pyc and __init__pyo, both of them binary files. With my app.py file, which I made with touch:
Code:root@caitlyn:~# ls /usr/lib64/python2.7/importlib/
__init__.pyc __init__.pyo app.py
root@caitlyn:~# file /usr/lib64/python2.7/importlib/__init__.pyc
/usr/lib64/python2.7/importlib/__init__.pyc: python 2.7 byte-compiled
root@caitlyn:~# file __init__.pyo
__init__.pyo: cannot open `__init__.pyo' (No such file or directory)
root@caitlyn:~# file /usr/lib64/python2.7/importlib/__init__.pyo
/usr/lib64/python2.7/importlib/__init__.pyo: python 2.7 byte-compiled
root@caitlyn:~#Any help with resolving this issue will be appreciated. Thank you in advance for any advice you can offer.