Update Django from 1.7.1 to 1.9.2. ImportError: cannot import name "importlib"

I just upgraded Django from 1.7.1 to 1.9.2. When I start the server, I get:

from django.utils import importlib
ImportError: cannot import name 'importlib'

I noticed that /lib/python3.4/site-packages/django/utilsthere is no file inside importlib.py, as it was in the previous version. Has anyone fixed this issue?

+4
source share
1 answer

django.utils.importlibwas deprecated in Django 1.7 and removed in Django 1.9. Change your import:

from django.utils import importlib

to

import importlib

Django, , . 1,7 1,8, 1,8 1,9, , , Django 1.8 , .

+6

Source: https://habr.com/ru/post/1628369/


All Articles