OS 3.3.12 crashes when spawning experiment process, "context has already been set"
Hi,
trying to resurrect OS on Arch Linux. Everything seems OK except that experiments won't run, "Python seems to have crashed". Console output below. Any help greatly appreciated!
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/python3.10/multiprocessing/spawn.py", line 116, in spawn_main
exitcode = _main(fd, parent_sentinel)
File "/usr/lib/python3.10/multiprocessing/spawn.py", line 125, in _main
prepare(preparation_data)
File "/usr/lib/python3.10/multiprocessing/spawn.py", line 236, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "/usr/lib/python3.10/multiprocessing/spawn.py", line 287, in _fixup_main_from_path
main_content = runpy.run_path(main_path,
File "/usr/lib/python3.10/runpy.py", line 289, in run_path
return _run_module_code(code, init_globals, run_name,
File "/usr/lib/python3.10/runpy.py", line 96, in _run_module_code
_run_code(code, mod_globals, init_globals,
File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
exec(code, run_globals)
File "/usr/bin/opensesame", line 5, in <module>
from libqtopensesame.__main__ import opensesame
File "/usr/lib/python3.10/site-packages/libqtopensesame/__main__.py", line 29, in <module>
multiprocessing.set_start_method('spawn')
File "/usr/lib/python3.10/multiprocessing/context.py", line 243, in set_start_method
raise RuntimeError('context has already been set')
RuntimeError: context has already been set
Comments
To follow up: This seems to be a consequence of running with python 3.8 or higher (Arch is on 3.10), see here for example.
A quick (and probably dangerous/unsatisfactory) fix is to change line 29 of
/usr/lib/python3.nn/site-packages/libqtopensesame/__main__.pyto readmultiprocessing.set_start_method('spawn', force=True)which appears to solve the issue (not thoroughly tested yet though).