Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

arguments did not match any overloaded call:

I'm trying to run an eye-tracking experiment on OpenSesame. However, when I try to run my experiment I get the following message:

TypeError: arguments did not match any overloaded call:

 save(self, fileName: Optional[str], format: Optional[str] = None, quality: int = -1): argument 1 has unexpected type 'QBuffer'

 save(self, device: Optional[QIODevice], format: Optional[str] = None, quality: int = -1): argument 1 has unexpected type 'QBuffer'


Running this same experiment in a different computer that has the same exact setup (I copied the virtual environment from one computer to the other) works just fine.


Any suggestions?

Comments

  • Hi @joao_craveiro ,

    Can you post the full traceback (from the console) so that it's clear where the error originates?

    — Sebastiaan

  • I am getting the same error. Here is the traceback:

    Traceback (most recent call last):
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/opensesame_extensions/core/preload_items/preload_items.py", line 67, in _on_awake
        self._preload_one_item()
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/opensesame_extensions/core/preload_items/preload_items.py", line 82, in _preload_one_item
        item.edit_widget()
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/libqtopensesame/items/feedpad.py", line 73, in edit_widget
        self.sketchpad_widget.draw()
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/libqtopensesame/widgets/sketchpad_widget.py", line 420, in draw
        element.draw()
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/libqtopensesame/sketchpad_elements/_base_element.py", line 70, in draw
        self.graphics_item = super(base_element, self).draw()
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/libopensesame/sketchpad_elements/_textline.py", line 53, in draw
        return self.canvas.text(properties[u'text'],
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/libqtopensesame/misc/sketchpad_canvas.py", line 623, in text
        im = t._to_pil()
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/openexp/_canvas/_richtext/richtext.py", line 243, in _to_pil
        im = self._qimage_to_pil(self._to_qimage())
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/openexp/_canvas/_richtext/richtext.py", line 223, in _qimage_to_pil
        return Image.fromqimage(self._to_qimage())
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/PIL/Image.py", line 3164, in fromqimage
        return ImageQt.fromqimage(im)
      File "/home/extra-laptop/.local/lib/python3.10/site-packages/PIL/ImageQt.py", line 81, in fromqimage
        im.save(buffer, "png")
    TypeError: arguments did not match any overloaded call:
      save(self, str, format: str = None, quality: int = -1): argument 1 has unexpected type 'QBuffer'
      save(self, QIODevice, format: str = None, quality: int = -1): argument 1 has unexpected type 'QBuffer'
    

    In my case, it started when I transferred the experiment to a new device (ubuntu) with a fresh opensesame install.

  • I get the same error while trying to set up an experiment with a tobii eyetracker.

    The error occurs when I open opensesame (without actually running anything or opening my experiment).

    (Anaconda installation of OpenSesame with python3.10).

    The full traceback is the following:


    Traceback (most recent call last):

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\opensesame_extensions\core\preload_items\preload_items.py", line 67, in _on_awake

      self._preload_one_item()

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\opensesame_extensions\core\preload_items\preload_items.py", line 82, in _preload_one_item

      item.edit_widget()

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\libqtopensesame\items\feedpad.py", line 73, in edit_widget

      self.sketchpad_widget.draw()

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\libqtopensesame\widgets\sketchpad_widget.py", line 420, in draw

      element.draw()

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\libqtopensesame\sketchpad_elements\_base_element.py", line 70, in draw

      self.graphics_item = super(base_element, self).draw()

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\libopensesame\sketchpad_elements\_textline.py", line 53, in draw

      return self.canvas.text(properties[u'text'],

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\libqtopensesame\misc\sketchpad_canvas.py", line 623, in text

      im = t._to_pil()

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\openexp\_canvas\_richtext\richtext.py", line 243, in _to_pil

      im = self._qimage_to_pil(self._to_qimage())

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\openexp\_canvas\_richtext\richtext.py", line 223, in _qimage_to_pil

      return Image.fromqimage(self._to_qimage())

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\PIL\Image.py", line 3164, in fromqimage

      return ImageQt.fromqimage(im)

     File "C:\Users\Behav2_Stim\anaconda3\envs\opensesame-py3\lib\site-packages\PIL\ImageQt.py", line 81, in fromqimage

      im.save(buffer, "png")

    TypeError: arguments did not match any overloaded call:

     save(self, fileName: Optional[str], format: Optional[str] = None, quality: int = -1): argument 1 has unexpected type 'QBuffer'

     save(self, device: Optional[QIODevice], format: Optional[str] = None, quality: int = -1): argument 1 has unexpected type 'QBuffer'



    According to chatgpt the problem is the following:


    "The error message you're seeing is related to the PIL (Python Imaging Library) and PyQt integration, specifically when trying to convert a QImage to a PIL.Image object. The problem arises when the save method is called with a QBuffer object, which the save method does not expect.".


    Unfortunately, I'm not sure how to solve it without trying to change the code that is being called from the scripts. I tried to update the PIL and pyqt5 packages, but that did not solve the problem.

  • I'm not entirely sure where this comes from, but it seems to be an incompatibility between PIL and PyQt. Can you check which versions your are running of PyQt, Pillow, and OpenSesame?

    from PyQt5.QtCore import PYQT_VERSION_STR, QT_VERSION_STR; print(PYQT_VERSION_STR, QT_VERSION_STR)
    import PIL; print(PIL.__version__)
    from libopensesame.metadata import __version__; print(__version__)
    


  • PyQT: 5.15.10

    QT: 5.15.2

    Pillow: 10.3.0

    OpenSesame: 4.0.27

  • Hi there,

    Was this issue ever resolved? I am encountering a similar problem.

    Matthew

Sign In or Register to comment.

agen judi bola , sportbook, casino, togel, number game, singapore, tangkas, basket, slot, poker, dominoqq, agen bola. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 50.000 ,- bonus cashback hingga 10% , diskon togel hingga 66% bisa bermain di android dan IOS kapanpun dan dimana pun. poker , bandarq , aduq, domino qq , dominobet. Semua permainan bisa dimainkan hanya dengan 1 ID. minimal deposit 10.000 ,- bonus turnover 0.5% dan bonus referral 20%. Bonus - bonus yang dihadirkan bisa terbilang cukup tinggi dan memuaskan, anda hanya perlu memasang pada situs yang memberikan bursa pasaran terbaik yaitu http://45.77.173.118/ Bola168. Situs penyedia segala jenis permainan poker online kini semakin banyak ditemukan di Internet, salah satunya TahunQQ merupakan situs Agen Judi Domino66 Dan BandarQ Terpercaya yang mampu memberikan banyak provit bagi bettornya. Permainan Yang Di Sediakan Dewi365 Juga sangat banyak Dan menarik dan Peluang untuk memenangkan Taruhan Judi online ini juga sangat mudah . Mainkan Segera Taruhan Sportbook anda bersama Agen Judi Bola Bersama Dewi365 Kemenangan Anda Berapa pun akan Terbayarkan. Tersedia 9 macam permainan seru yang bisa kamu mainkan hanya di dalam 1 ID saja. Permainan seru yang tersedia seperti Poker, Domino QQ Dan juga BandarQ Online. Semuanya tersedia lengkap hanya di ABGQQ. Situs ABGQQ sangat mudah dimenangkan, kamu juga akan mendapatkan mega bonus dan setiap pemain berhak mendapatkan cashback mingguan. ABGQQ juga telah diakui sebagai Bandar Domino Online yang menjamin sistem FAIR PLAY disetiap permainan yang bisa dimainkan dengan deposit minimal hanya Rp.25.000. DEWI365 adalah Bandar Judi Bola Terpercaya & resmi dan terpercaya di indonesia. Situs judi bola ini menyediakan fasilitas bagi anda untuk dapat bermain memainkan permainan judi bola. Didalam situs ini memiliki berbagai permainan taruhan bola terlengkap seperti Sbobet, yang membuat DEWI365 menjadi situs judi bola terbaik dan terpercaya di Indonesia. Tentunya sebagai situs yang bertugas sebagai Bandar Poker Online pastinya akan berusaha untuk menjaga semua informasi dan keamanan yang terdapat di POKERQQ13. Kotakqq adalah situs Judi Poker Online Terpercayayang menyediakan 9 jenis permainan sakong online, dominoqq, domino99, bandarq, bandar ceme, aduq, poker online, bandar poker, balak66, perang baccarat, dan capsa susun. Dengan minimal deposit withdraw 15.000 Anda sudah bisa memainkan semua permaina pkv games di situs kami. Jackpot besar,Win rate tinggi, Fair play, PKV Games