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

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

MartinH
This post has NOT been accepted by the mailing list yet.
Hi!

I was just about to install mayavi2 from the github tree and stumbled across this error which obviously involves python-six. I can't even redirect the output of the mayavi command into standard output text file, so i have to type in the last relevant line manually:
content = self._handle_bom(content)
File "/usr/local/lib/python2.7/dist-packages/configobj-5.0.4-py2.7.egg/configobj.py", line 1477, in _handle_bom
if six.PY2 and insinstance(line, str):
AttributeError: 'module' object has no attribute 'PY2'

Any help on this is greatly appreciated! I have no idea what to change in that configobj.py file to make it work or what is causing this error.
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi2] AttributeError: 'module' object has no attribute 'PY2'

MartinH
This post has NOT been accepted by the mailing list yet.
Still no luck with this issue. Here is the full output of the command mayavi2:

Traceback (most recent call last):
  File "/usr/local/bin/mayavi2", line 9, in <module>
    load_entry_point('mayavi==4.3.2', 'gui_scripts', 'mayavi2')()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 343, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2309, in load_entry_point
    return ep.load()
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2015, in load
    entry = __import__(self.module_name, globals(),globals(), ['__name__'])
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/scripts/mayavi2.py", line 475, in <module>
    from mayavi.plugins.app import Mayavi, setup_logger
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/plugins/app.py", line 19, in <module>
    from mayavi_workbench_application import MayaviWorkbenchApplication
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/plugins/mayavi_workbench_application.py", line 17, in <module>
    import mayavi.api
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/api.py", line 2, in <module>
    from mayavi.core.engine import Engine
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/core/engine.py", line 28, in <module>
    from mayavi.core.base import Base
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/core/base.py", line 29, in <module>
    from mayavi.preferences.api import preference_manager
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/preferences/api.py", line 4, in <module>
    from preference_manager import preference_manager
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/preferences/preference_manager.py", line 128, in <module>
    preference_manager = PreferenceManager()
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/preferences/preference_manager.py", line 81, in __init__
    self._load_preferences()
  File "/usr/local/lib/python2.7/dist-packages/mayavi-4.3.2-py2.7-linux-x86_64.egg/mayavi/preferences/preference_manager.py", line 113, in _load_preferences
    default.load(pref_file)
  File "/home/martin/ets/apptools/apptools/preferences/preferences.py", line 365, in load
    config_obj = ConfigObj(file_or_filename)
  File "/usr/local/lib/python2.7/dist-packages/configobj-5.0.4-py2.7.egg/configobj.py", line 1229, in __init__
    self._load(infile, configspec)
  File "/usr/local/lib/python2.7/dist-packages/configobj-5.0.4-py2.7.egg/configobj.py", line 1287, in _load
    content = self._handle_bom(content)
  File "/usr/local/lib/python2.7/dist-packages/configobj-5.0.4-py2.7.egg/configobj.py", line 1477, in _handle_bom
    if six.PY2 and isinstance(line, str):
AttributeError: 'module' object has no attribute 'PY2'

Installation from github went without any trouble but i can't get mayavi gui to work...
Any ideas what i could try to fix this?
Reply | Threaded
Open this post in threaded view
|

Re: [mayavi2] AttributeError: 'module' object has no attribute 'PY2'

MartinH
This post has NOT been accepted by the mailing list yet.
Problem is solved. I have upgraded from Ubuntu 13.10 to Ubuntu 14.04 and it works now.