bennylope / django-organizations

:couple: Multi-user accounts for Django projects

Home Page:http://django-organizations.readthedocs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ModuleNotFoundError: No module named 'six'

libovness opened this issue · comments

Got the error that follows on:

Django==3.0.1
django-cors-headers==3.2.0
django-organizations==1.1.2
Traceback (most recent call last):
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/organizations/compat.py", line 8, in <module>
    import six  # noqa
ModuleNotFoundError: No module named 'six'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/local/Cellar/python/3.7.4_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/django/utils/autoreload.py", line 76, in raise_last_exception
    raise _exception[1]
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/django/core/management/__init__.py", line 357, in execute
    autoreload.check_errors(django.setup)()
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/django/utils/autoreload.py", line 53, in wrapper
    fn(*args, **kwargs)
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
    app_config.import_models()
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
    self.models_module = import_module(models_module_name)
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/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 "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/organizations/models.py", line 26, in <module>
    from organizations.abstract import AbstractOrganization
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/organizations/abstract.py", line 32, in <module>
    from organizations.base import AbstractBaseOrganization
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/organizations/base.py", line 32, in <module>
    from organizations.compat import six
  File "/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/organizations/compat.py", line 10, in <module>
    from django.utils import six  # noqa
ImportError: cannot import name 'six' from 'django.utils' (/Users/user/.virtualenvs/soapboat/lib/python3.7/site-packages/django/utils/__init__.py)

The immediate fix is going to be adding six as a requirement in your project. The 1.x series of Django Organizations isn't guaranteed to support Django 3 however (though after adding six I think it largely should?). The 2.x series is available on PyPI as pre-release, and work is underway to make that the default published series.