trying to use the DaskExecutor to process a json l...
# prefect-community
a
trying to use the DaskExecutor to process a json list of records, and am getting this error?
n
Hi @Aaron Y - this looks to be a Windows-specific bug, I think a solution can be found here: https://stackoverflow.com/questions/18204782/runtimeerror-on-windows-trying-python-multiprocessing
a
I'm on macos
n
Ah I see. Can you share some code and a stack trace (instead of a screenshot)?
a
Copy code
The "freeze_support()" line Task exception was never retrieved
future: <Task finished name='Task-14' coro=<_wrap_awaitable() done, defined at /usr/local/anaconda3/lib/python3.8/asyncio/tasks.py:677> exception=RuntimeError('\n        An attempt has been made to start a new process before the\n        current process has finished its bootstrapping phase.\n\n        This probably means that you are not using fork to start your\n        child processes and you have forgotten to use the proper idiom\n        in the main module:\n\n            if __name__ == \'__main__\':\n                freeze_support()\n                ...\n\n        The "freeze_support()" line can be omitted if the program\n        is not going to be frozen to produce an executable.')>
Traceback (most recent call last):
  File "/usr/local/anaconda3/lib/python3.8/asyncio/tasks.py", line 684, in _wrap_awaitable
    return (yield from awaitable.__await__())
  File "/Users/aaronyang/.local/share/virtualenvs/PostProcessing_Template-c6_vRqT-/lib/python3.8/site-packages/distributed/core.py", line 305, in _
    await self.start()
  File "/Users/aaronyang/.local/share/virtualenvs/PostProcessing_Template-c6_vRqT-/lib/python3.8/site-packages/distributed/nanny.py", line 295, in start
    response = await self.instantiate()
  File "/Users/aaronyang/.local/share/virtualenvs/PostProcessing_Template-c6_vRqT-/lib/python3.8/site-packages/distributed/nanny.py", line 378, in instantiate
    result = await self.process.start()
  File "/Users/aaronyang/.local/share/virtualenvs/PostProcessing_Template-c6_vRqT-/lib/python3.8/site-packages/distributed/nanny.py", line 575, in start
    await self.process.start()
  File "/Users/aaronyang/.local/share/virtualenvs/PostProcessing_Template-c6_vRqT-/lib/python3.8/site-packages/distributed/process.py", line 34, in _call_and_set_future
    res = func(*args, **kwargs)
  File "/Users/aaronyang/.local/share/virtualenvs/PostProcessing_Template-c6_vRqT-/lib/python3.8/site-packages/distributed/process.py", line 202, in _start
    process.start()
  File "/usr/local/anaconda3/lib/python3.8/multiprocessing/process.py", line 121, in start
    self._popen = self._Popen(self)
  File "/usr/local/anaconda3/lib/python3.8/multiprocessing/context.py", line 283, in _Popen
    return Popen(process_obj)
  File "/usr/local/anaconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 32, in __init__
    super().__init__(process_obj)
  File "/usr/local/anaconda3/lib/python3.8/multiprocessing/popen_fork.py", line 19, in __init__
    self._launch(process_obj)
  File "/usr/local/anaconda3/lib/python3.8/multiprocessing/popen_spawn_posix.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/usr/local/anaconda3/lib/python3.8/multiprocessing/spawn.py", line 154, in get_preparation_data
    _check_not_importing_main()
  File "/usr/local/anaconda3/lib/python3.8/multiprocessing/spawn.py", line 134, in _check_not_importing_main
    raise RuntimeError('''
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.
can be omitted if the program
        is not going to be frozen to produce an executable.
the
transform
function just prints the keys of each dict
n