Skip to content

Django 3.0 - no module named six #1697

@ajwillo

Description

@ajwillo
  • Tested with the latest Haystack release
    Tested with the current Haystack master branch

Expected behaviour

Django shell launches

Actual behaviour

shell fails with error importing six, six has been deprecated in Django 3.0

root@853074fcc9ea:/itapp/itapp# ./manage.py shell
Traceback (most recent call last):
  File "./-manage.py", line 22, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 377, in execute
    django.setup()
  File "/usr/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.6/site-packages/django/apps/registry.py", line 91, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 678, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/usr/local/lib/python3.6/site-packages/haystack/__init__.py", line 11, in <module>
    from haystack.utils import loading
  File "/usr/local/lib/python3.6/site-packages/haystack/utils/__init__.py", line 9, in <module>
    from django.utils import six
ImportError: cannot import name 'six'
root@853074fcc9ea:/itapp/itapp#

Steps to reproduce the behaviour

  1. upgrade Django to 3.0, six has been deprecated

Configuration

  • Operating system version:
  • Search engine version: search 5.1.6
  • Python version: 3.6.6
  • Django version: Django==3.0
  • Haystack version: django-haystack==2.8.2.dev70+g49eacb3

Activity

string-areeb

string-areeb commented on Dec 10, 2019

@string-areeb

This should be reopened. six is still imported in utils/__init__.py

from django.utils import six

acdha

acdha commented on Dec 10, 2019

@acdha
Contributor

@string-areeb feel free to send another pull request — it should be an easy test

string-areeb

string-areeb commented on Dec 11, 2019

@string-areeb

There are many more places where it is still used. Will see if I get time

added a commit that references this issue on Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Participants

      @acdha@ajwillo@string-areeb

      Issue actions

        Django 3.0 - no module named six · Issue #1697 · django-haystack/django-haystack