psychopy.org | Reference | Downloads | Github

ioHub and Ubuntu 16.04

I am trying to get ioHub (from psychopy 1.8.5-2) running on Ubuntu 16.04. Unfortunately I receive an error, because it can’t load the xlib (but python-xlib is installed via pip). I use Python2.7.

I have ported ioSync.ino to an Arduino Mega and now I want to try it out, but without ioHub running that might get difficult. Debugging ioHub has shown to be difficult, as ioHub is quite complex. Maybe it is better to draw ioSync out of ioHub and build something tiny, but that would only be an option, if ioHub didn’t run.

So, is there anybody who runs ioHub under Ubuntu 16.04?

What is the error? It might be related to this - I’m not sure that the fix ever made it into the repository.

Running launchHub.py from the demos I get the following:


------------------------------------

Running testWithNoKwargs Test:
Error XXX during device creation ....
<type 'exceptions.ImportError'>
ImportError('No module named Xlib',)
['  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/server.py", line 524, in __init__\n    self.createNewMonitoredDevice(device_class_name,deviceConfig)\n',
 '  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/server.py", line 662, in createNewMonitoredDevice\n    from .devices import pyXHook\n',
 '  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/devices/pyXHook.py", line 51, in <module>\n    from .Xlib import X, display\n']
<class 'psychopy.iohub.util.exception_tools.ioHubError'>
ioHubError:
Args: ('Error YYY during device creation ....',)

['  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/launchHubProcess.py", line 36, in run\n    s = ioServer(rootScriptPathDir, ioHubConfig)\n',
 '  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/server.py", line 528, in __init__\n    raise ioHubError("Error YYY during device creation ....")\n']
Traceback (most recent call last):
  File "/home/detlef/gitlab/ioSyncArduinoMega/ioSyncDemo/launchHub.py", line 159, in <module>
    result = namespace[test]()
  File "/home/detlef/gitlab/ioSyncArduinoMega/ioSyncDemo/launchHub.py", line 28, in testWithNoKwargs
    io = launchHubServer()
  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/client/__init__.py", line 1509, in launchHubServer
    return ioHubConnection(ioConfig)
  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/client/__init__.py", line 293, in __init__
    raise RuntimeError("Error starting ioHub server: %s"%(self.iohub_status))
RuntimeError: Error starting ioHub server: ioHub startup timed out. iohub Server startup Failed. startup_read: here3

startup_read: here3

startup_read: here3

startup_read: 

A more elaborated error message from here gives this:

------------------------------------

Running testWithNoKwargs Test:
======================================================
Started load process for: Display
#### createNewMonitoredDevice: Display
======================================================
Started load process for: Experiment
#### createNewMonitoredDevice: Experiment
======================================================
Started load process for: Keyboard
#### createNewMonitoredDevice: Keyboard
Error XXX during device creation ....
----- Called by function ----
__init__
----- Exc Type -----------
<type 'exceptions.ImportError'>
----- Exc Value ------------
ImportError('No module named Xlib',)
----- Exc Traceback ---------
['  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/server.py", line 524, in __init__\n    self.createNewMonitoredDevice(device_class_name,deviceConfig)\n',
 '  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/server.py", line 662, in createNewMonitoredDevice\n    from .devices import pyXHook\n',
 '  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/devices/pyXHook.py", line 51, in <module>\n    from .Xlib import X, display\n']
-----------------
----- Called by function ----
run
----- Exc Type -----------
<class 'psychopy.iohub.util.exception_tools.ioHubError'>
----- Exc Value ------------
ioHubError:
Args: ('Error YYY during device creation ....',)

----- Exc Traceback ---------
['  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/launchHubProcess.py", line 36, in run\n    s = ioServer(rootScriptPathDir, ioHubConfig)\n',
 '  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/server.py", line 528, in __init__\n    raise ioHubError("Error YYY during device creation ....")\n']
-----------------
Traceback (most recent call last):
  File "/home/detlef/gitlab/ioSyncArduinoMega/ioSyncDemo/launchHub.py", line 159, in <module>
    result = namespace[test]()
  File "/home/detlef/gitlab/ioSyncArduinoMega/ioSyncDemo/launchHub.py", line 28, in testWithNoKwargs
    io = launchHubServer()
  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/client/__init__.py", line 1509, in launchHubServer
    return ioHubConnection(ioConfig)
  File "/usr/local/lib/python2.7/dist-packages/PsychoPy-1.85.2-py2.7.egg/psychopy/iohub/client/__init__.py", line 293, in __init__
    raise RuntimeError("Error starting ioHub server: %s"%(self.iohub_status))
RuntimeError: Error starting ioHub server: ioHub startup timed out. iohub Server startup Failed. startup_read: here3

startup_read: here3

startup_read: here3

startup_read: 


Maybe try downgrading to 1.85.1 and see if that works - I see that there was a recent change in how Xlib is imported in pyXHook.py that might be involved.

You are right. There is no .Xlib, so reverting it to Xlib solved the problem.

Thank you. :relieved:

Will you do the pull request or should I?

Could you please make the pull request? I don’t know git / github very well.

I have done so.

Just to have it documented: I use python-xlib-0.19 from pip

1 Like

Pull request is merged now. So i delete my fork.