Welcome!

Sign in with your CogSci, Facebook, Google, or Twitter account.

Or register to create a new account.

We'll use your information only for signing in to this forum.

Supported by

Extension get_started misbehaved on event startup (see debug window for stack trace)

hikehike Posts: 34
edited February 8 in OpenSesame

Opensesame 3.1.6, Arch linux

    Extension error

    item-stack: 
    exception message: fromTheme() takes no keyword arguments
    time: Wed Feb  8 15:59:14 2017
    exception type: TypeError

    Traceback:
      File "/usr/lib/python2.7/site-packages/libqtopensesame/extensions/_extension_manager.py", line 133, in fire
        ext.fire(event, **kwdict)
      File "/usr/lib/python2.7/site-packages/libqtopensesame/extensions/_base_extension.py", line 386, in fire
        getattr(self, u'event_%s' % event)(**kwdict)
      File "/usr/share/opensesame_extensions/get_started/get_started.py", line 108, in event_startup
        self.main_window.open_file(path=path)
      File "/usr/lib/python2.7/site-packages/libqtopensesame/qtopensesame.py", line 760, in open_file
        self.ui.pool_widget.refresh()
      File "/usr/lib/python2.7/site-packages/libqtopensesame/widgets/pool_widget.py", line 184, in refresh
        icon = self.theme.qfileicon(self.pool[path])
      File "/usr/lib/python2.7/site-packages/libqtopensesame/misc/theme.py", line 123, in qfileicon
        fallback=QtGui.QIcon.fromTheme(fallback))
    TypeError: fromTheme() takes no keyword arguments

I've just notice that this leads to variable inspector not showing and pool shown as empty. Clicking on variable inspector button does nothing, but clicking on pool button gives the following.

    Traceback (most recent call last):
      File "/usr/lib/python2.7/site-packages/libqtopensesame/qtopensesame.py", line 618, in toggle_pool
        self.ui.pool_widget.refresh()
      File "/usr/lib/python2.7/site-packages/libqtopensesame/widgets/pool_widget.py", line 184, in refresh
        icon = self.theme.qfileicon(self.pool[path])
      File "/usr/lib/python2.7/site-packages/libqtopensesame/misc/theme.py", line 123, in qfileicon
        fallback=QtGui.QIcon.fromTheme(fallback))
    TypeError: fromTheme() takes no keyword arguments

Looks like something with the theme and Qt libs?

Hike

Comments

  • sebastiaansebastiaan Posts: 2,592

    Hi Hike,

    You're using an incompatible version of PyQt—probably a very old version of PyQt4, because fromTheme() has accepted the fallback keyword for ages. I would check your package manager to see which version you're using, and upgrade if possible; or install PyQt5 (in which case you'll probably have to install several PyQt5 packages, but you'll find that out along the way).

    Cheers!
    Sebastiaan

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • hikehike Posts: 34
    edited February 9

    I've got python-pyqt4 4.12-4 installed as well as python2-pyqt5 5.7.1-3 , which are the latest on https://riverbankcomputing.com/software/pyqt/download

    Arch linux is a rolling disto, so it usually has the latest (more or less stable) packages.

  • sebastiaansebastiaan Posts: 2,592

    What do you see if you run the following lines in a Python interpreter (make sure it's the same Python as used by OpenSesame):

    import qtpy
    import os
    print(os.environ['QT_API'])
    

    This will print out the Qt Python library that is used. There are three possibilities: pyqt (= PyQt4), pyqt5, and pyside. The first two should work; the last one is untested.

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

  • hikehike Posts: 34

    It gives me pyqt5 both in OpenSesame and in python interpreter. Both use Python 2.7.13, which is the latest.

    Thanks for looking into this!

  • hikehike Posts: 34

    Sebastiaan, do you think AnyQt ( https://pypi.python.org/pypi/AnyQt/0.0.6 ) might be helpful here?
    I'm using Orange ( http://orange.biolab.si/ ), and they recently implemented this to fight the PyQt4 vs PyQt5 issue.

  • sebastiaansebastiaan Posts: 2,592
    edited March 16

    @Daniel just sent a pull request (520) to fix this issue, so it should be resolved in 3.1.7.

    Sebastiaan, do you think AnyQt ( https://pypi.python.org/pypi/AnyQt/0.0.6 ) might be helpful here?

    OpenSesame uses something similar, called qtpy, to provide compatibility with both PyQt4 and PyQt5. But these compatibility layers essentially just remap the way you import PyQt modules. They don't change the APIs at the level of keywords and arguments, which is the problem here. I suspect that they PyQt developers accidentally changed this.

    There's much bigger issues in the world, I know. But I first have to take care of the world I know.
    cogsci.nl/smathot

Sign In or Register to comment.