Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 3.0 - no module named six #1697

Closed
1 of 2 tasks
ajwillo opened this issue Dec 3, 2019 · 3 comments · Fixed by #1696
Closed
1 of 2 tasks

Django 3.0 - no module named six #1697

ajwillo opened this issue Dec 3, 2019 · 3 comments · Fixed by #1696

Comments

@ajwillo
Copy link

ajwillo commented Dec 3, 2019

  • 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
@string-areeb
Copy link

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

from django.utils import six

@acdha
Copy link
Contributor

acdha commented Dec 10, 2019

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

@string-areeb
Copy link

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

acdha added a commit that referenced this issue Jan 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants