I am unable to pilot an experiment in a browser from PsychoPy Studio 2026.2.1 on macOS.
When I click Pilot Experiment in Browser, a browser window opens but remains blank. PsychoPy Studio then displays an error dialog titled:
Error in “Pilot Experiment in Browser”
The dialog reports:
Error invoking remote method 'python.psychojs.run':
Error: ERR_CONNECTION_REFUSED (-102) loading
'http://localhost:8016/?_pilotToken=local'
Environment
- Application: PsychoPy Studio 2026.2.1
- Operating system: macOS Sequoia 15.7.7
- Mac processor: intel
- Experiment type: Builder experiment compiled for PsychoJS
- Project status: Experiment files are synchronized with Pavlovia and the corresponding GitLab repository
- VPN or proxy: disabled
- macOS firewall: disabled
Studio also prints the following traceback:
opening handshake failed
Traceback (most recent call last):
File "/Users/<username>/Library/Application Support/psychopy4/.python/2026.2.1/lib/python3.11/site-packages/websockets/http11.py", line 138, in parse
request_line = yield from parse_line(read_line)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/<username>/Library/Application Support/psychopy4/.python/2026.2.1/lib/python3.11/site-packages/websockets/http11.py", line 320, in parse_line
line = yield from read_line(MAX_LINE_LENGTH)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/<username>/Library/Application Support/psychopy4/.python/2026.2.1/lib/python3.11/site-packages/websockets/streams.py", line 46, in read_line
raise EOFError(f"stream ends after {p} bytes, before end of line")
EOFError: stream ends after 0 bytes, before end of line
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/<username>/Library/Application Support/psychopy4/.python/2026.2.1/lib/python3.11/site-packages/websockets/server.py", line 547, in parse
request = yield from Request.parse(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/<username>/Library/Application Support/psychopy4/.python/2026.2.1/lib/python3.11/site-packages/websockets/http11.py", line 140, in parse
raise EOFError("connection closed while reading HTTP request line") from exc
EOFError: connection closed while reading HTTP request line
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/<username>/Library/Application Support/psychopy4/.python/2026.2.1/lib/python3.11/site-packages/websockets/asyncio/server.py", line 356, in conn_handler
await connection.handshake(
File "/Users/<username>/Library/Application Support/psychopy4/.python/2026.2.1/lib/python3.11/site-packages/websockets/asyncio/server.py", line 207, in handshake
raise self.protocol.handshake_exc
websockets.exceptions.InvalidMessage: did not receive a valid HTTP request
I have tried restarting the mac and psychopy. i have updated from studio 2026.1.3 to 2026.2.1. This error occurs even using very simply experiment files.
I have successfully synced the experiment to pavlovia and can run the experiment in my browser when in ‘run’ mode. but making changes is a bit tedious as i need to re-sync and wait for the changes to take place. i’d love to be able to just pilot locally and not have to continually push changes to gitlab.