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

TypeError: Error when calling the metaclass bases #31

Closed
realtkd opened this issue Oct 27, 2017 · 4 comments
Closed

TypeError: Error when calling the metaclass bases #31

realtkd opened this issue Oct 27, 2017 · 4 comments

Comments

@realtkd
Copy link

realtkd commented Oct 27, 2017

Hi.

I tried to get a local version of AraPheno running but it seems there is some conflict with the autocomplete_light which causes the process to bail out with

TypeError: Error when calling the metaclass bases metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

This appears to be a problem of autocomplete_light version 2.3.3 (see their issue #914). I tried the latest version of autocomplete_light without success. Since you apparently have a version running at https://arapheno.1001genomes.org, I was wondering if you could check the requirements in this repo to see if there are any differences w.r.t. to the production system?

@dominikgrimm
Copy link
Collaborator

Hi,

I just cloned the repo and created a new virtual environment for testing. I do not have any problems. It works fine for me. Do you have sqlite3 installed?

Googling your error I found this on Stackoverflow:

https://stackoverflow.com/questions/11276037/python-3-typeerror-metaclass-conflict-the-metaclass-of-a-derived-class-must-b

@realtkd
Copy link
Author

realtkd commented Oct 27, 2017

Hi,

thanks for the feedback. I did the very same thing (clone, virtual env with python version 2.7.5) and yes, sqlite3 is installed. I re-cloned the repo, just to be sure, but the error persist. The full Traceback is:

$ manage.py runserver

Unhandled exception in thread started by <function wrapper at 0x4067a28>
Traceback (most recent call last):
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/core/management/commands/runserver.py", line 109, in inner_run
    autoreload.raise_last_exception()
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/apps/registry.py", line 115, in populate 
    app_config.ready()
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/autocomplete_light/apps.py", line 9, in ready 
    autodiscover()
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/autocomplete_light/registry.py", line 327, in autodiscover
    autodiscover_modules('autocomplete_light_registry')
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/utils/module_loading.py", line 50, in autodiscover_modules
    import_module('%s.%s' % (app_config.name, module_to_search))
  File "/usr/lib64/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
  File "/home/michael/projects/arapheno/arapheno/home/autocomplete_light_registry.py", line 4, in <module> 
    from autocomplete_light import shortcuts as autocomplete_light
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/autocomplete_light/shortcuts.py", line 8, in <module> 
    from .forms import *
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/autocomplete_light/forms.py", line 438, in <module> 
    class ModelForm(six.with_metaclass(*bases)):
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/autocomplete_light/forms.py", line 283, in __new__
    attrs)
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/forms/models.py", line 208, in __new__
    new_class = super(ModelFormMetaclass, mcs).__new__(mcs, name, bases, attrs)
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/forms/forms.py", line 42, in __new__
    .__new__(mcs, name, bases, attrs))
  File "/home/michael/projects/arapheno/venv2.7/lib/python2.7/site-packages/django/forms/widgets.py", line 152, in __new__
    .__new__(mcs, name, bases, attrs))
TypeError: Error when calling the metaclass bases
    metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases  

@realtkd
Copy link
Author

realtkd commented Oct 27, 2017

I found the solution. The six package is not listed in the requirements so its latest version (1.11.0) get s pulled in as a dependency which causes the above error. When explicitly installing six version 1.9.0 (pip install six==1.9.0) everything works as expected.

@dominikgrimm
Copy link
Collaborator

thanks for finding the issue. I will add it to the dependency list.

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

No branches or pull requests

2 participants