ImportError: cannot import name RemovedInDjango19Warning

I'm on Django 1.8.7, and I just installed Django-Allauth, cloning the repo and running the pip installation in the application directory in my webapp on the terminal. Now when I run manage.py migrate, I get this error:

➜src git:(master) ✗ python manage.py migrate
    Traceback (most recent call last):
      File "manage.py", line 8, in <module>
        from django.core.management import execute_from_command_line
      File "/Library/Python/2.7/site-packages/django/core/management/__init__.py", line 10, in <module>
        from django.apps import apps
      File "/Library/Python/2.7/site-packages/django/apps/__init__.py", line 1, in <module>
        from .config import AppConfig
      File "/Library/Python/2.7/site-packages/django/apps/config.py", line 6, in <module>
        from django.utils.module_loading import module_has_submodule
      File "/Library/Python/2.7/site-packages/django/utils/module_loading.py", line 4, in <module>
        from importlib import import_module
      File "/Library/Python/2.7/site-packages/django/utils/importlib.py", line 6, in <module>
        from django.utils.deprecation import RemovedInDjango19Warning
    ImportError: cannot import name RemovedInDjango19Warning
    ➜  src git:(master) ✗ 

enter image description here

I checked, and I'm still on django 1.8.7, so it has not been accidentally updated.

+4
source share
3 answers

@MaxRah This is caused by conflicts in Django versions. As others have already mentioned, you will have to uninstall pip dinstall deinstall django and reinstall your preferred version: pip install django == 1.9 This should fix the problem.

+6

, 1.8.7 (from importlib import import_module 8, 4). Django .

Django, virtualenv. - python . , , - , Django .

+1

cron-jobs python ( kronos)

#getting error while trying to run kronos cron job
python manage.py runtask complain

@olivrg , ( django 1.8.X, 1.9X)

sudo pip uninstall django

sudo pip install django==1.9
0

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


All Articles