Howdy, Stranger!

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

Supported by

[solved] Pygaze example doesn't work.

rrrrrr
edited September 2015 in PyGaze

Hello,

I'm really interested in Pygaze, and try to use it in my eyelink studies.
Already installed all requirements in my Mac (OS Marvericks), according to the instructions.
I use Python 2.7.10, Eyelink1000plus.

"Simple_tracker_experiment.py" didn't run, when I tried to confirm that operation.
The error was below.

Traceback (most recent call last):
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygaze/examples/simple_tracker_experiment/simple_tracker_experiment.py", line 20, in
tracker = eyetracker.EyeTracker(disp)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygaze/eyetracker.py", line 56, in init
from libeyelink import libeyelink
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygaze/libeyelink.py", line 37, in
import Image
ImportError: No module named Image
Process finished with exit code 1

What should I do?

Sorry for my beginner skill, but I appreciate for your help.

Comments

  • edited 10:08PM

    Hi,

    No Mac user here, so here are just some guesses.
    Did you select the Eyelink in the pygaze_init module? ("select tracker type" is on "simple dummy" by default). If it still doesn't work when set to Eyelink, you can also try to set it to "advanced dummy" (where your mouse substitutes for the eyetracker input). If that works, then at least you can be sure the problem is due to the eyetracker setup.

    Cheers

    Josh

  • edited 10:08PM

    Hi guys,

    I think @Josh misunderstood the question a bit, as he is referring to the OpenSesame plug-in. From your question, I seem to make out you are trying to run an example Python script, correct?

    To be honest, Mac is always a bit of an issue. I have little experience with the platform, and although I'm used to Linux (which is also UNIX), sometimes the two correspond way too little for me to make any kind of intelligent argument. That said, let's try to get you sorted.

    The traceback you posted indicates that the error occurs when PyGaze tries to import Image, which is the Python Image Library (or PIL, for short). It could well be you forgot to install this, as it is only one of the many dependencies.

    On the PyGaze website's installation page, there's a link to one PIL installer, that seems to have last been updated for Python 2.5. Note that this might not work on Python 2.7.

    Alternatively, you could download and install the source package by following the instructions on good ol' StackOverflow. This requires you to open a Terminal, and run the following commands:

    # download
    curl -O -L http://effbot.org/media/downloads/Imaging-1.1.7.tar.gz
    # extract
    tar -xzf Imaging-1.1.7.tar.gz
    cd Imaging-1.1.7
    # build and install
    python setup.py build
    sudo python setup.py install
    # or install it for just you without requiring admin permissions:
    # python setup.py install --user
    

    After doing this, running the example shouldn't give you the same error, because Imaging can then be imported. There might be further issues, though! For example, are you aware that you're trying to run the example script with an EyeLink attached? (It's not set to dummy mode.) This is fine, as long as you've installed the EyeLink software, including the pylink Python library.

    Good luck with the process! (And sorry it's such a hassle to install: welcome to Python on Mac...)

    Edwin

  • rrrrrr
    edited 10:08PM

    Thank you for your prompt reply.

    As I said, I already installed PIL.
    To confirm it, when I re-tried to install it (this install way is by Macports), the Terminal said below.

    $ sudo port install py27-pil
    ---> Computing dependencies for py27-pil
    ---> Activating py27-pil @1.1.7_7
    Error: org.macports.activate for port py27-pil returned: Image error: /opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin/pilconvert.py already exists and does not belong to a registered port. Unable to activate port py27-pil. Use 'port -f activate py27-pil' to force the activation.
    Please see the log file for port py27-pil for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_python_py-pil/py27-pil/main.log
    To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
    Error: Processing of port py27-pil failed

    You can see PIL already exists.

    Other library which I use for my experiment and image processing using PIL works well.

    Sorry to bother you, but I appreciate for your help.

  • rrrrrr
    edited 10:08PM

    Hello,

    I modified my " ImportError: No module named Image " by forcing activation of PIL according to error messages on terminal.

    However, another error happened as below.

    Traceback (most recent call last):
    File "/Users/ryotachibana/Desktop/PyGaze-master/examples/simple_tracker_experiment/simple_tracker_experiment.py", line 25, in
    tracker = eyetracker.EyeTracker(disp)
    File
    "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygaze/eyetracker.py", line 56, in init
    from libeyelink import libeyelink
    File
    "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pygaze/libeyelink.py", line 38, in
    custom_display = pylink.EyeLinkCustomDisplay
    AttributeError: 'module' object has no attribute 'EyeLinkCustomDisplay'
    Process finished with exit code 1

    How do I correct it?

  • rrrrrr
    edited September 2015

    Hello,

    Thank you for your advise.
    I have good news.

    I succeeded to use Pygaze in Mac.

    I found that we should install the EyeLink Developer's Kit (https://www.sr-support.com/showthread.php?15-EyeLink-Developers-Kit-for-Mac-OS-X-(Mac-OS-X-Display-Software)).
    This will be installed in '/Application/'.

    We can chose the suitable version of pylink for our Python (e.g. pylink2.7) from '/Application/Eyelink/pylink/'.
    After the choice, we should copy it to the directory we usually use (in my case, opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7).
    Don't forget to rename it from 'pylink2.7' to 'pylink', and create the path between your Python and the directory includes pylink.

    This works well!

    I hope for your information.

  • edited 10:08PM

    This is great news, thanks for sharing your solution!

Sign In or Register to comment.