realtime MNE MockLSLStream error

Dear MNE users,

Currently, I am trying to test simple realtime mne code (plot real-time epoch data with LSL client)

Plot real-time epoch data with LSL client — MNE-Realtime 0.1.dev0 documentation

In the code,
stream = MockLSLStream(host, raw, ‘eeg’)

geneartes the error as follows,

RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

Do you know how to solve the error?

Kyu

Hello, I have never used MNE Realtime, but maybe @teonbrooks can point you in the right direction?

Hi @kyuwanchoi, what operating system are you using? also just to check, do you have pylsl instead as well?

Hi teonbrooks, my operating system is Windows 10 Enterprise and I already installed pylsl. The error message is as follows,

RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.

    This probably means that you are not using fork to start your
    child processes and you have forgotten to use the proper idiom
    in the main module:

        if __name__ == '__main__':
            freeze_support()
            ...

    The "freeze_support()" line can be omitted if the program
    is not going to be frozen to produce an executable.

ok, with Windows machines, it’s related to this issue (BUG: Get LSLMockClient to work on multiprocessing · Issue #9 · mne-tools/mne-realtime · GitHub) and this stackoverflow entry (python - Compulsory usage of if __name__=="__main__" in windows while using multiprocessing - Stack Overflow).

How are you running this example? are you using python plot_lslclient_rt.py

I’m not super well-versed in the Windows execution environment. maybe @larsoner has a suggestion if this still poses a problem for you

1 Like

How are you running this example? are you using python plot_lslclient_rt.py

Agreed this might matter. I can try running on my Windows machine to replicate once we know how things are being run…