Dask error when running modin.pandas

I’m trying to run modin.pandas on a Windows 10 machine using Dask. I’m developing using PyCharm.I installed all the packages, but when I run the program, the following errors and warnings appear:

UserWarning: The Dask Engine for Modin is experimental.
UserWarning: The Dask Engine for Modin is experimental.
UserWarning: The Dask Engine for Modin is experimental.
UserWarning: The Dask Engine for Modin is experimental.
UserWarning: The Dask Engine for Modin is experimental.
UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 58832 instead
UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 58833 instead
UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 58834 instead
UserWarning: The Dask Engine for Modin is experimental.
UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 58838 instead
UserWarning: The Dask Engine for Modin is experimental.
UserWarning: The Dask Engine for Modin is experimental.
UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 58850 instead
UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 58857 instead
UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 58859 instead
UserWarning: The Dask Engine for Modin is experimental.
UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 58869 instead
Task exception was never retrieved
future: <Task finished name='Task-12' coro=<_wrap_awaitable() done, defined at C:\Users\Mihai\AppData\Local\Programs\Python\Python38-32\lib\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 "C:\Users\Mihai\AppData\Local\Programs\Python\Python38-32\lib\asyncio\tasks.py", line 684, in _wrap_awaitable
return (yield from awaitable.__await__())
File "C:\Users\Mihai\AppData\Roaming\Python\Python38\site-packages\distributed\nanny.py", line 291, in start
response = await self.instantiate()
File "C:\Users\Mihai\AppData\Roaming\Python\Python38\site-packages\distributed\nanny.py", line 374, in instantiate
result = await self.process.start()
File "C:\Users\Mihai\AppData\Roaming\Python\Python38\site-packages\distributed\nanny.py", line 567, in start
await self.process.start()
File "C:\Users\Mihai\AppData\Roaming\Python\Python38\site-packages\distributed\process.py", line 34, in _call_and_set_future
res = func(*args, **kwargs)
File "C:\Users\Mihai\AppData\Roaming\Python\Python38\site-packages\distributed\process.py", line 202, in _start
process.start()
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python38-32\lib\multiprocessing\process.py", line 121, in start
self._popen = self._Popen(self)
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python38-32\lib\multiprocessing\context.py", line 224, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python38-32\lib\multiprocessing\context.py", line 326, in _Popen
return Popen(process_obj)
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python38-32\lib\multiprocessing\popen_spawn_win32.py", line 45, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python38-32\lib\multiprocessing\spawn.py", line 154, in get_preparation_data
_check_not_importing_main()
File "C:\Users\Mihai\AppData\Local\Programs\Python\Python38-32\lib\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.
Task exception was never retrieved

I tried manually configuring the Client by changing the port, but regardless the port used, it still doesn’t work. If I run “dask-scheduler” in the terminal, there are not errors.

What could be the issue?

Hi @yo2mno,

This is a known issue with trying to run with Dask in a script. The fix can be found here: https://github.com/modin-project/modin/issues/843

Please feel free to comment on that issue if you run into any issues.

1 Like

Hi @devin-petersohn,

Thanks for the solutions. Now it works.