0

I understand that I asked this question an hour or so ago, but it was closed as a duplicate. I have however tried the solutions suggested in the other question, including upgrading my django, making changes to models and utils.py

#from
from django.core import urlresolvers
#to
from django.urls import reverse

but still getting 'cannot import name urlresolvers' as an error when I try run manage.py runserver.

This is the full error

Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\threading.py", line 926, in _bootstrap_inne
r
    self.run()
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py",
line 54, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\comman
ds\runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py",
line 77, in raise_last_exception
    raise _exception[1]
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\core\management\__init
__.py", line 337, in execute
    autoreload.check_errors(django.setup)()
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\utils\autoreload.py",
line 54, in wrapper
    fn(*args, **kwargs)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\__init__.py", line 24,
 in setup
    apps.populate(settings.INSTALLED_APPS)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\registry.py", lin
e 114, in populate
    app_config.import_models()
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\django\apps\config.py", line
211, in import_models
    self.models_module = import_module(models_module_name)
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\importlib\__init__.py", line 127, in import
_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\allauth\account\models.py", l
ine 17, in <module>
    from .utils import user_email
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\allauth\account\utils.py", li
ne 30, in <module>
    from ..utils import (import_callable, valid_email_or_none,
  File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\site-packages\allauth\utils.py", line 8, in
 <module>
    from django.core import urlresolvers
ImportError: cannot import name 'urlresolvers' from 'django.core' (C:\Users\User\AppData\Local\Programs\Pyth
on\Python37\lib\site-packages\django\core\__init__.py)

Just to reiterate- I have tried the solutions suggested here -> ImportError: No module named 'django.core.urlresolvers'

Emm
  • 2,367
  • 3
  • 24
  • 50
  • The error raised from [django-all-auth](https://github.com/pennersr/django-allauth) package. Upgrading the same may resolve the issue – JPG Dec 17 '19 at 18:01
  • 1
    @JPG Thanks upgrading the package seems to have worked – Emm Dec 17 '19 at 18:11

0 Answers0