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

AttributeError: 'module' object has no attribute 'add_metaclass' #449

Closed
lindemann09 opened this Issue Sep 22, 2014 · 5 comments

Comments

Projects
None yet
5 participants
@lindemann09
Copy link

lindemann09 commented Sep 22, 2014

Hi,

Glue is crashing on startup if running under Ubuntu 12.04 LTS (see below). All dependencies are installed.

I couldn't see a reason to install an additional third-party Python environment such as Anaconda that might interfere with my current stable Python ecosystem. Unfortunately, the website is not clear about whether Anaconda is a dependency or, if not, why it is recommended?

Best,
Oliver

~$ glue
Traceback (most recent call last):
  File "/usr/local/bin/glue", line 9, in <module>
    load_entry_point('glueviz==0.3.0', 'console_scripts', 'glue')()
  File "/usr/local/lib/python2.7/dist-packages/glue/main.py", line 226, in main
    start_glue(config=opt.config)
  File "/usr/local/lib/python2.7/dist-packages/glue/main.py", line 171, in start_glue
    ga = GlueApplication(session=session)
  File "/usr/local/lib/python2.7/dist-packages/glue/qt/glue_application.py", line 195, in __init__
    self._create_actions()
  File "/usr/local/lib/python2.7/dist-packages/glue/qt/glue_application.py", line 505, in _create_actions
    if len(exporters) > 0:
  File "/usr/local/lib/python2.7/dist-packages/glue/config.py", line 62, in __len__
    return len(self.members)
  File "/usr/local/lib/python2.7/dist-packages/glue/config.py", line 44, in members
    self._members = self.default_members() + self._members
  File "/usr/local/lib/python2.7/dist-packages/glue/config.py", line 111, in default_members
    import glue.plugins  # discover plugins
  File "/usr/local/lib/python2.7/dist-packages/glue/plugins/__init__.py", line 2, in <module>
    from . import export_plotly
  File "/usr/local/lib/python2.7/dist-packages/glue/plugins/export_plotly.py", line 5, in <module>
    from plotly import plotly
  File "/usr/local/lib/python2.7/dist-packages/plotly/__init__.py", line 31, in <module>
    from plotly import plotly, graph_objs, tools, utils
  File "/usr/local/lib/python2.7/dist-packages/plotly/plotly/__init__.py", line 10, in <module>
    from . plotly import (
  File "/usr/local/lib/python2.7/dist-packages/plotly/plotly/plotly.py", line 29, in <module>
    from plotly import tools
  File "/usr/local/lib/python2.7/dist-packages/plotly/tools.py", line 21, in <module>
    from . graph_objs import graph_objs
  File "/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/__init__.py", line 12, in <module>
    from . graph_objs import (
  File "/usr/local/lib/python2.7/dist-packages/plotly/graph_objs/graph_objs.py", line 251, in <module>
    @six.add_metaclass(ListMeta)
AttributeError: 'module' object has no attribute 'add_metaclass'
@ChrisBeaumont

This comment has been minimized.

Copy link
Member

ChrisBeaumont commented Sep 22, 2014

Hi Oliver,

Anaconda isn't a dependency, just a bundle of python libraries that is an easy way to install Glue's dependencies. So you don't have to use it if you don't want.

It looks like plotly might be expecting a more recent version of six than what you have. What happens when you run these lines?

import six
print six.__version__

import plotly
print plotly.__version__

My guess is that you might need to run pip install --upgrade six to get plotly to import, and then glue should startup for you

@lindemann09

This comment has been minimized.

Copy link

lindemann09 commented Sep 23, 2014

That's it. The update to six version 1.8 fixed the problem. Ubuntu 12.04 includes version 1.1. Maybe adding the required six version to the dependency is helpful for others.

(The problem was that with six 1.1.0 plotly could not be import correctly.)

Thanks for your quick response.

@kobigi

This comment has been minimized.

Copy link

kobigi commented Jan 30, 2016

Hi
on centos 7 i had the same error, suggested solution as is above failed (don' know why)
Finally uninstalling and installing worked and i could continue devstack deployment
#sudo pip uninstall six
#sudo pip install six
regards

@nallagondu

This comment has been minimized.

Copy link

nallagondu commented Aug 13, 2018

AttributeError: 'module' object has no attribute 'add_metaclass'

Can any one help me to resolve it
Problem while running Ansible :

]# ansible -m all ping
ERROR! Unexpected Exception, this is probably a bug: 'module' object has no attribute

'add_metaclass'
the full traceback was:

Traceback (most recent call last):
File "/usr/bin/ansible", line 97, in
mycli = getattr(import("ansible.cli.%s" % sub, fromlist=[myclass]), myclass)
File "/usr/lib/python2.7/site-packages/ansible/cli/init.py", line 38, in
from ansible.inventory.manager import InventoryManager
File "/usr/lib/python2.7/site-packages/ansible/inventory/manager.py", line 33, in
from ansible.plugins.loader import inventory_loader
File "/usr/lib/python2.7/site-packages/ansible/plugins/loader.py", line 22, in
from ansible.parsing.utils.yaml import from_yaml
File "/usr/lib/python2.7/site-packages/ansible/parsing/utils/yaml.py", line 17, in
from ansible.parsing.yaml.loader import AnsibleLoader
File "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/loader.py", line 30, in
from ansible.parsing.yaml.constructor import AnsibleConstructor
File "/usr/lib/python2.7/site-packages/ansible/parsing/yaml/constructor.py", line 29, in
from ansible.parsing.vault import VaultLib
File "/usr/lib/python2.7/site-packages/ansible/parsing/vault/init.py", line 46, in
from cryptography.hazmat.primitives import hashes, padding
File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/primitives/hashes.py", line 15, in
from cryptography.hazmat.backends.interfaces import HashBackend
File "/usr/lib64/python2.7/site-packages/cryptography/hazmat/backends/interfaces.py", line 12, in
@six.add_metaclass(abc.ABCMeta)
AttributeError: 'module' object has no attribute 'add_metaclass'

@astrofrog

This comment has been minimized.

Copy link
Member

astrofrog commented Aug 20, 2018

@nallagondu - try updating the six package:

pip install six --upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment