I've just upgraded Django from 1.7.1 to 1.9.2. When I run the server I get:
from django.utils import importlib
ImportError: cannot import name 'importlib'
I noticed that there is no importlib.py
file inside /lib/python3.4/site-packages/django/utils
like it used to be in the previous version. Has anyone fixed this issue?
django.utils.importlib
was deprecated in Django 1.7 and removed in Django 1.9. Change your imports from:
from django.utils import importlib
to
import importlib
Before you upgrade Django, it's a good idea to read through the release notes to check for backwards incompatible changes like this. If you upgrade from 1.7 to 1.8 and then 1.8 to 1.9, it's less likely that your code will break, because Django 1.8 will show deprecation warnings which you can fix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With