ValueError: cannot find context for 'fork'. (Windows)
gety9 opened this issue · 1 comments
gety9 commented
Windows 10
Python 3.8.3
Running python beangrow/compute_returns.py b.beancount conf-returns out
results in error:
Traceback (most recent call last):
File "beangrow/compute_returns.py", line 105, in <module>
main()
File "beangrow/compute_returns.py", line 86, in main
pricer = reports.generate_reports(account_data_map, config,
File "R:\b\b-office\beangrow\reports.py", line 459, in generate_reports
multiprocessing.set_start_method('fork')
File "C:\Users\Btycoon\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py", line 247, in set_start_method
self._actual_context = self.get_context(method)
File "C:\Users\Btycoon\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py", line 239, in get_context
return super().get_context(method)
File "C:\Users\Btycoon\AppData\Local\Programs\Python\Python38\lib\multiprocessing\context.py", line 193, in get_context
raise ValueError('cannot find context for %r' % method) from None
ValueError: cannot find context for 'fork'
Apparently caused by https://stackoverflow.com/a/46021480
Temporary fixed it by adjusting reports.py
multiprocessing.set_start_method('fork')
changed to
multiprocessing.set_start_method('spawn')
(solution taken from here woven-planet/l5kit#129 (comment))
floatingheads commented
@gety9 this is exactly what I did as well.