Howdy, Stranger!

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

Supported by

[solved] PyGaze with Tobii tracker: "No module named ImageDraw" error

edited September 2015 in PyGaze

Attempting to run a very basic eye-tracking experiment based off the PyGaze eye-tracking template, I'm running into an error where PyGaze's libtobii attempts to import ImageDraw. The error I get is:

Unexpected error

line: 72
exception message: No module named ImageDraw
exception type: ImportError

  File "dist\libqtopensesame\misc\", line 139, in run
  File "dist\libopensesame\", line 347, in run
  File "dist\libopensesame\", line 47, in run
  File "C:\Program Files (x86)\OpenSesame\plugins\pygaze_init\", line 198, in run
  File "dist\pygaze\", line 86, in __init__
  File "dist\pygaze\_eyetracker\", line 72, in <module>
ImportError: No module named ImageDraw

This is on Windows 7, OpenSesame 2.9.7 (32 bit), using the pre-bundled PyGaze installation. The only change I've made to the default OpenSesame install is copying the tobii SDK modules into the OpenSesame folder.

It looks like libtobii should be doing something like from PIL import ImageDraw, as the PIL modules definitely seem to be included in the OpenSesame install and can be accessed as long as you import them through PIL. I would be happy to edit the pygaze files myself to use the correct imports, but it seems like only .pyc files are provided in the bundled pygaze, not the original .py files?


  • After writing this post I realized I could work around the issue using an inline_script that added the PIL folder to the path:

    import sys
    sys.path.append(r"C:\Program Files (x86)\OpenSesame\PIL")

    So my immediate issue is solved for the moment and I was able to run through an example experiment.

  • edited 5:10PM

    Great, thanks for posting your solution!

Sign In or Register to comment.