I use to run Python 2 and had a fully working Django application. I have now decided to switch to Python 3 and went with 3.6. When I try to run my tests I now get the following stack trace:
Traceback (most recent call last):
File "/Users/jonathan/Work/GenettaSoft/modeling-web/modeling/manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/Users/jonathan/anaconda/lib/python3.6/site-packages/django/core/management/__init__.py", line 350, in execute_from_command_line
utility.execute()
File "/Users/jonathan/anaconda/lib/python3.6/site-packages/django/core/management/__init__.py", line 324, in execute
django.setup()
File "/Users/jonathan/anaconda/lib/python3.6/site-packages/django/__init__.py", line 18, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/jonathan/anaconda/lib/python3.6/site-packages/django/apps/registry.py", line 115, in populate
app_config.ready()
File "/Users/jonathan/anaconda/lib/python3.6/site-packages/django/contrib/admin/apps.py", line 22, in ready
self.module.autodiscover()
File "/Users/jonathan/anaconda/lib/python3.6/site-packages/django/contrib/admin/__init__.py", line 26, in autodiscover
autodiscover_modules('admin', register_to=site)
File "/Users/jonathan/anaconda/lib/python3.6/site-packages/django/utils/module_loading.py", line 50, in autodiscover_modules
import_module('%s.%s' % (app_config.name, module_to_search))
File "/Users/jonathan/anaconda/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 978, in _gcd_import
File "<frozen importlib._bootstrap>", line 961, in _find_and_load
File "<frozen importlib._bootstrap>", line 950, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 655, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 205, in _call_with_frames_removed
File "/Users/jonathan/Work/GenettaSoft/modeling-web/modeling/licenses/admin.py", line 2, in <module>
from models import LicenseModel
ModuleNotFoundError: No module named 'models'
Some googling first led me to http://www.daveoncode.com/2017/03/07/how-to-solve-python-modulenotfound-no-module-named-import-error/ but I don't think any of those situations apply --- after all, it was running fine in Python 2. Next I stumbled on https://github.com/jpadilla/django-rest-framework-xml/issues/17 which led me to make sure I had defusedxml==0.5.0
which didn't really help. More desperately I then tried what is explained here ModuleNotFound error in django in Django tastypie web application which didn't really make sense to me but didn't either fix the problem. So now I am running out of ideas so here I am asking you. What's going on and what can I do?