Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#25868 closed Bug (invalid)

Importing django.test.utils.get_runner fails on Django 1.9 with Python 3.3

Reported by: Lewis Sobotkiewicz Owned by: nobody
Component: Testing framework Version: 1.9
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The following code:

from django.test.utils import get_runner

Errors out with the following traceback in Django 1.9 with Python 3.3:

Traceback (most recent call last):
  File "", line 116, in <module>
    runtests(failfast=options.failfast, verbosity=options.verbosity, coverage=options.coverage, *args)
  File "", line 92, in runtests
    from django.test.utils import get_runner
  File "/usr/local/lib/python3.3/site-packages/django/test/", line 5, in <module>
    from django.test.client import Client, RequestFactory
  File "/usr/local/lib/python3.3/site-packages/django/test/", line 12, in <module>
    from django.apps import apps
  File "/usr/local/lib/python3.3/site-packages/django/apps/", line 1, in <module>
    from .config import AppConfig
  File "/usr/local/lib/python3.3/site-packages/django/apps/", line 6, in <module>
    from django.utils.module_loading import module_has_submodule
  File "/usr/local/lib/python3.3/site-packages/django/utils/", line 67, in <module>
    from importlib.util import find_spec as importlib_find
ImportError: cannot import name find_spec

Apparently importlib.util.find_spec appeared in Python 3.4 and thus fails to import in Python 3.2 and 3.3:

Change History (1)

comment:1 by Tim Graham, 8 years ago

Resolution: invalid
Status: newclosed

From the 1.9 release notes:

Django 1.9 requires Python 2.7, 3.4, or 3.5. We highly recommend and only officially support the latest release of each series. Since Django 1.8, we’ve dropped support for Python 3.2 and 3.3.

Note: See TracTickets for help on using tickets.
Back to Top