psychopy.org | Reference | Downloads | Github

Eyelink and iohub for python2

Hi All, hoping for some help debugging. The brief is that I want to get psychopy working with an eyelink1000, which only functions with python 3.4 or 2.7. So, I’m trying to set up iohub with an older version of psychopy and am running into an odd problem with the import. I have the same bug for psychopy v2020.1 and v3.2.4, shown below. The best I can describe it is that after importing iohub specifically (not just psychopy generally) I get the same message for every possible error, even if it is not a psychopy error (see the a+b test case where b is not defined). this is just after doing an import, nothing further than that. I found the documentation for what this error is thrown by in future, so I suspect it has something to do with the way iohub imports future, but I’m stumped on how to fix it. I’m using windows and the newest version of anaconda, with a pip install of psychopy (older versions). I also have tried multiple versions of pyglet, re this topic. can provide more information if it’s relevant. my pylink works fine, and I have all the stuff from the SR Research website, so it’s just iohub that I’m running into problems with. thanks for any help !!

(hpy2) C:\Users\hkeglovi>python
Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 17:26:54) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 1
>>> a+b
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'b' is not defined
>>> import psychopy
>>> import psycopy.iohub
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named psycopy.iohub
>>> import psychopy.iohub
Warning: display device module could not be imported.
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
>>> a+b
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
>>> exit()

(hpy2) C:\Users\hkeglovi>python
Python 2.7.18 |Anaconda, Inc.| (default, Apr 23 2020, 17:26:54) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
## the error persists even if I import future. 
>>> import future
>>> a = 1
>>> a+b
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'b' is not defined
>>> import psychopy
>>> from psychopy.core import getTime, wait
>>> from psychopy.iohub import launchHubServer
Warning: display device module could not be imported.
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
>>> a+b
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
>>> print("hello")
"<Unicode console <stdout>>.write: AttributeError('decode method has been disabled in newstr',)"
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
"<Unicode console <stderr>>.write: AttributeError('decode method has been disabled in newstr',)"
>>>

Can you use python 3.6 and the latest release of psychopy? The latest Psychopy standalone release for Windows should include everything you need, including a python 3.6 compatible version of pylink.

oh really? so I wouldn’t use any of the SR Research Software / API? That would be amazing…

That’s how it should work. Let us know if run into trouble. Thanks.

Will do! thank you so much.