Latest psychopy versions rendering TypeError: startswith first arg must be bytes or a tuple of bytes, not str

Hi,

When getting the latest psychopy version, I get the following error even with the simplest of experiments:

I’m installing via macos standalone with macOS Monterey 12.3


 File "/Applications/PsychoPy 4.app/Contents/Resources/lib/python3.8/psychopy/contrib/lazy_import.py", line 118, in __call__
    return obj(*args, **kwargs)
  File "/Applications/PsychoPy 4.app/Contents/Resources/lib/python3.8/psychopy/iohub/client/connect.py", line 260, in launchHubServer
    return ioHubConnection(iohub_config)
  File "/Applications/PsychoPy 4.app/Contents/Resources/lib/python3.8/psychopy/iohub/client/__init__.py", line 294, in __init__
    self.iohub_status = self._startServer(ioHubConfig, ioHubConfigAbsPath)
  File "/Applications/PsychoPy 4.app/Contents/Resources/lib/python3.8/psychopy/iohub/client/__init__.py", line 944, in _startServer
    self._osxKillAndFreePort()
  File "/Applications/PsychoPy 4.app/Contents/Resources/lib/python3.8/psychopy/iohub/client/__init__.py", line 1348, in _osxKillAndFreePort
    if line.startswith('Python'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str
################ Experiment ended with exit code 1 [pid:25958] #################

This one just started appearing on our test suite. Not sure what coul dhave changed - that code hasn’t changed in many years but the fix is here:

Thanks! How can I download psychopy now with this change?

It’s in 2023.2.1 which was uploaded this morning:

Hi @jon ,

Thanks, experiments are still not starting up for me:

See error message here on start up:


replication_basic_lastrun.py", line 213, in setupInputs
    ioServer = io.launchHubServer(window=win, **ioConfig)
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/contrib/lazy_import.py", line 118, in __call__
    return obj(*args, **kwargs)
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/iohub/client/connect.py", line 260, in launchHubServer
    return ioHubConnection(iohub_config)
  File "/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/iohub/client/__init__.py", line 296, in __init__
    raise RuntimeError('Error starting ioHub server: {}'.format(self.iohub_status))
RuntimeError: Error starting ioHub server: ioHub startup failed.

Thanks! -ross

You could try changing the keyboard backend from ioHub to pyglet.
You’ll find the option under experiment options → input.