Howdy, Stranger!

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

Supported by

Gazepoint Control Version 4.2.0 used with PyGaze and Opensesame - Calibration Error

edited May 2018 in PyGaze

Hi there,

We have been using a GazePoint eyetracker with version 4.1 of the Controller, Opensesame 3.1.9, and the latest release of the PyGaze package on Windows 7 and Windows 10 machine without incurring into any major trouble. I have been helped by @moreno and @alisdt to set it up.

However, we wanted to update the Gazepoint Control to their latest release, which is 4.2.0. The reason is that it implements a new "P" mode for tracking difficult eyes, and we are often dealing with elderly and clinical populations which are actually harder to track.

But, when we try to run the Gazepoint Version 4.2.0, we got the following error during the calibration phase:

Starting experiment as ExperimentProcess-3
openexp._canvas.legacy.init_display(): enabling hardware surface
openexp._canvas.legacy.init_display(): enabling double buffering
openexp._canvas.legacy.init_display(): video mode ok
openexp.sampler._legacy.init_sound(): sampling freq = 48000, buffer size = 1024
openexp.sampler._legacy.init_sound(): mixer already initialized, closing experiment started at Thu May 31 15:06:43 2018 disabling garbage collection
Exception in thread PyGaze_OpenGazeConnection_incoming:
Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenSesame\lib\", line 801, in __bootstrap_inner
  File "C:\Program Files (x86)\OpenSesame\lib\", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\", line 428, in _process_incoming
    command, msgdict = self._parse_msg(msg)
  File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\", line 350, in _parse_msg
    e = lxml.etree.fromstring(xml)
  File "src\lxml\etree.pyx", line 3213, in lxml.etree.fromstring
  File "src\lxml\parser.pxi", line 1876, in lxml.etree._parseMemoryDocument
  File "src\lxml\parser.pxi", line 1764, in lxml.etree._parseDoc
  File "src\lxml\parser.pxi", line 1126, in lxml.etree._BaseParser._parseDoc
  File "src\lxml\parser.pxi", line 600, in lxml.etree._ParserContext._handleParseResultDoc
  File "src\lxml\parser.pxi", line 710, in lxml.etree._handleParseResult
  File "src\lxml\parser.pxi", line 639, in lxml.etree._raiseParseError
XMLSyntaxError: attributes construct error, line 1, column 30 (line 1)

@moreno and I suspect that in this latest 4.2.0 of the Gazepoint Control, something in the API must have been changed and consequently PyGaze cannot parse the XML.
As we really are not that familiar with the implementation of PyGaze, we would have to ask PyGaze experts here, as well as you @Edwin, whether you have encountered a similar problem before; and especially whether you would be so kind to help us resolve this issue.

Thank you very much for your precious time.


  • Heya!

    Thanks for the elaborate description and for posting the full traceback, those are very useful! I hope you don't mind, but I changed your post ever so slightly by putting the traceback info between ~~~ flags to make it render as code. This makes it slightly more readable :)

    As for the actual issue: It sounds like your analysis is correct. I haven't tried the new API yet, so haven't run into the issue myself, but your error message is from the lxml library (which is native Python; not something that we concocted!), and seems to indicate that the xml message that it tried to parse was malformed. For example, this can happen when a space is missing from the message, or a closing quotation is forgotten.

    Whether this malformed message came directly from the GP tracker is something that is hard to say. It could well be, but it could also be that the message was partly lost along the way someplace. One thing you could try is to ask GazePoint about this specific point, as they will know whether they might have changed anything that could have introduced malformed xml.

    In the meantime, if I have some time (which is not likely to be very soon - especially not this week or the next), I'll have a look at whether I can reproduce the error, and whether I can find a workaround.

    Good luck!

  • edited June 2018

    Hi there,

    we have been in touch with Gazepoint developers and apparently, a potential source of conflict was that in Gazepoint 4.2 there was a bug

    <ACK ID="USER_DATA" VALUE="0"DUR="0" /> 

    Basically, a missing space ...

    So, they gave us today an updated version (4.3) to be released very soon wherein such bug was fixed.
    I do not know whether that was the true cause of the problem, but we seem now to be able to track just fine using PyGaze and Opensesame, and their latest 4.3 version ... so, at least for now ... problem solved!


  • Hi Moreno,

    Amazing, thanks for the update! That missing space is very likely to have been the cause of the lxml hickup, as it would fail to understand that VALUE="0"DUR="0" actually means VALUE="0" AND DUR="0".


    PS: I totes called it :sunglasses:

    [...] this can happen when a space is missing from the message [...]

  • Hi all,

    I am posting in this thread rather than creating a new one because I suspect it is a similar issue. In both Gazepoint 4.3 and the new 5.1 release, I encounter this error at the pygaze_init object (with opengaze selected as the tracker). I'm using Windows 10 with OpenSesame 3.2.5.

    File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\misc\", line 157, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 456, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 103, in execute
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 122, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 51, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 122, in run
      File "C:\Program Files (x86)\OpenSesame\share\opensesame_plugins\pygaze_init\", line 217, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\", line 118, in __init__
        from pygaze._eyetracker.libopengaze import OpenGazeTracker
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\", line 41, in <module>
        from opengaze import OpenGazeTracker as OpenGaze
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\", line 13, in <module>
        import lxml.etree
    ImportError: No module named lxml.etree

    If you suspect it's another bug in the Gazepoint API, I will follow up with them.

    Thanks all! And special thanks to @Edwin for adding Gazepoint to PyGaze and keeping the dream of cheap eye tracking alive :)


  • edited November 2018

    Hi Tom,

    Good to see you here! Thanks for flagging this up. It's due to a bug (malformed xml) in the GazePoint API. There are two workarounds:

    1) You can ask GazePoint for a pre-release of their API, which had the bug fixed.

    2) We built a workaround into PyGaze, I just forgot to put it on GitHub. Will upload it first thing tomorrow!

    EDIT: Actually, on closer inspection, it seems like this is a slightly different error that I'm used to! (Don't worry, you'll also run into the above error in time ;) ) It seems like for whatever reason, the lxml library isn't installed. You can install it using the following command in a terminal:

    pip install lxml

    Alternatively, within OpenSesame, you can run the following in the Debug Window:

    import pip
    pip.main(["install", "lxml"])


  • UPDATE: The GazePoint OpenGaze API malformed XML bug should be fixed with the latest commit. Grab the code of GitHub directly, and update your local PyGaze installation with it. See here:

  • Thanks Edwin! I'm looking forward to using the GP3 :) I think I'm almost there. I ran that code in the debug window in OpenSesame, and here is what happened:

    Collecting lxml
      Using cached
    Installing collected packages: lxml
    Traceback (most recent call last):
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\", line 215, in main
        status =, args)
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\commands\", line 342, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\req\", line 784, in install
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\req\", line 851, in install
        self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\req\", line 1064, in move_wheel_files
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\", line 345, in move_wheel_files
        clobber(source, lib_dir, True)
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\", line 316, in clobber
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pip\utils\", line 83, in ensure_dir
      File "C:\Program Files (x86)\OpenSesame\lib\", line 157, in makedirs
        mkdir(name, mode)
    WindowsError: [Error 5] Access is denied: 'C:\\Program Files (x86)\\OpenSesame\\Lib\\site-packages\\lxml'
    You are using pip version 9.0.1, however version 18.1 is available.
    You should consider upgrading via the 'python -m pip install --upgrade pip' command.

    I have admin privileges, so not sure what the issue is. I tried it through my command prompt with the other code and got this error:
    'pip' is not recognized as an internal or external command,
    operable program or batch file.

    Is my windows command prompt different than the terminal you had in mind? (Pardon my cluelessness/helplessness!) I tried the Python 3.4 command line, too, but no luck.

    Perhaps it was premature, but I moved on and replaced the and files in my pygaze folder (within my OpenSesame folder) with the new versions on GitHub. Then I tried running OpenSesame with Opengaze as the tracker type and got this error:

    File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libqtopensesame\misc\", line 157, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 456, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 103, in execute
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 122, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 51, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\libopensesame\", line 122, in run
      File "C:\Program Files (x86)\OpenSesame\share\opensesame_plugins\pygaze_init\", line 217, in run
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\", line 118, in __init__
        from pygaze._eyetracker.libopengaze import OpenGazeTracker
      File "C:\Program Files (x86)\OpenSesame\lib\site-packages\pygaze\_eyetracker\", line 7
        <!DOCTYPE html>
    SyntaxError: invalid syntax

    Thanks for any advice you have!!

  • About pip in your command window: you probably need to add the path of your pip installation to the path system variable. Find the path to your pip. It will probably be in a folder like "C:\Python\Scripts", which is what I will use below as an example.
    Open your command window in your python folder (probably; I don't have much experience with python and windows) and type echo %PATH%. If the folder containing your pip installation is note there, you can add it with setx PATH "%PATH%; C:\Python\Scripts". Since this is Windows, you might have to restart your cmd window for any changes to take effect.

    About your second issue; if you download from git rather than clone, I noticed that one might run into formatting inconsistencies. Simply open the downloaded file in an editor and remove anything at the top that's not Python.

  • Thanks cesco! As you suspected, I did the GitHub download wrong. Now I am back to the 'No module named lxml.etree error'. So I just need to get the lxml library installed, which I will now try with your advice regarding the path...

  • I was able to install lmxl from the debug window once I ran OpenSesame as an administrator. Now I'm all set! Thanks everyone for your help! Very cool to see how the Gazepoint calibration routine plays out in PyGaze/OpenSesame! :)

  • Great to hear, Tom! :smile:

  • Hi all, I am new in eyetracker and got a lot of help in this forum. Thanks for amazing contribution in making Gazepoint GP3 works. Such a great elaboration. I tried from very basic and follow the step from this thread. I got a lot of errors but finally GP3 runs with no problem, however it take a several time (that I think lagging or error) to load 9 point calibration. I use Win 7, Win 8 and Win 10 respectively. Also, pylink only work with 32 bit, so if you use psychopy you have to change the OS with win 7 32 bit. From all these OS, only win 7 32 bit could outperformed with no error (as Edwin suggest it in his book). This is what I collected from this forum and work for me:
    Gazepoint work around with PyGaze and OpenSesame
    1. Start Opensesame with run as administrator
    2. Make sure Opensesame in latest version with PyGaze 06.0a25
    3. Add pip path (C:\Python27\Scripts)
    4. Continue with import pip and start install lxml modul with pip.main(["install", "lxml"]). After the instalation is complete, restart opensesame.
    5. In pygaze_init change the dummy to opengaze
    6. Done

  • Hello!! my name is Camila, I am trying to recreate an OpenSesame experiment using the gazepoint GP3 eye tracker. 

    The Opensesame version is 3.3.12, Python is 3.7.6.  I am having a problem similar to the ones presented above. I will show it, however nothing seems to work, I've tried the recomendations presented here, also I've updated the, and codes with the latest github version, updated the last pip version, try to move the folders, etc.

    I will tremendously appreciate any advice/solution in other to recreate the experiment with the eye tracker.




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 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