Skip to content
This repository has been archived by the owner on May 21, 2021. It is now read-only.

django.utils.module_loading import import_by_path #32

Open
ghost opened this issue Aug 18, 2017 · 1 comment
Open

django.utils.module_loading import import_by_path #32

ghost opened this issue Aug 18, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Aug 18, 2017

$ ./manage.py omnibusd
Traceback (most recent call last):
File "./manage.py", line 22, in
execute_from_command_line(sys.argv)
File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/django/core/management/init.py", line 363, in execute_from_command_line
utility.execute()
File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/django/core/management/init.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/django/core/management/init.py", line 205, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/django/core/management/init.py", line 40, in load_command_class
module = import_module('%s.management.commands.%s' % (app_name, name))
File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 978, in _gcd_import
File "", line 961, in _find_and_load
File "", line 950, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 678, in exec_module
File "", line 205, in _call_with_frames_removed
File "/Users/gbc/virtualenvs/todo_be/lib/python3.6/site-packages/omnibus/management/commands/omnibusd.py", line 4, in
from django.utils.module_loading import import_by_path
ImportError: cannot import name 'import_by_path'

Changed 3 years ago by Tim Graham <timograham@…>
In d029fafea1a1f2f257397fbcd0fa3b531e09854f:
Removed utils.module_loading.import_by_path() per deprecation timeline; refs #21674.

Was giving django-omnibus a go, and hit this import error. What are the version requirements for this product? Will Django 11.1 be supported?

@ghost
Copy link
Author

ghost commented Aug 18, 2017

ok a bit confused now

try:
from django.utils.module_loading import import_string
except ImportError:
from django.utils.module_loading import import_by_path as import_string

And then tried this in shell

In [1]: from django.utils.module_loading import import_string

works.

pip installed django-omnibus==0.2.0

and has this at line 4

from django.utils.module_loading import import_by_path

So, looks like problem fixed in source but that hasn't been deployed upstream. Should I just pull from here, instead of getting pip version?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants