ValueError: cannot find context for 'fork'
See original GitHub issueI’m running it on Windows 10. I get the error when running
from pandarallel import pandarallel
pandarallel.initialize()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-5-b7dddfb62cf5> in <module>
----> 1 from pandarallel import pandarallel
2 pandarallel.initialize()
~\Anaconda3\envs\pipeline\lib\site-packages\pandarallel\__init__.py in <module>
1 __version__ = "1.5.1"
2
----> 3 from .pandarallel import pandarallel
~\Anaconda3\envs\pipeline\lib\site-packages\pandarallel\pandarallel.py in <module>
25 # Python 3.8 on MacOS by default uses "spawn" instead of "fork" as start method for new
26 # processes, which is incompatible with pandarallel. We force it to use "fork" method.
---> 27 context = get_context("fork")
28
29 # By default, Pandarallel use all available CPUs
~\Anaconda3\envs\pipeline\lib\multiprocessing\context.py in get_context(self, method)
236 return self._actual_context
237 else:
--> 238 return super().get_context(method)
239
240 def set_start_method(self, method, force=False):
~\Anaconda3\envs\pipeline\lib\multiprocessing\context.py in get_context(self, method)
190 ctx = _concrete_contexts[method]
191 except KeyError:
--> 192 raise ValueError('cannot find context for %r' % method) from None
193 ctx._check_available()
194 return ctx
ValueError: cannot find context for 'fork'
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
On Windows 10, ValueError: cannot find context for 'fork' #129
When I tried to run visualise_data.ipynb on Windows, I received the following error: D:\l5kit\l5kit\l5kit\dataset\select_agents.py in 20 ...
Read more >Wikipedia extractor problem ValueError: cannot find context ...
ValueError : cannot find context for 'fork'. Here is stack trace with "spawn" instead of "fork" parameter. "spawn" parameter stack trace.
Read more >context.py - Google Git
'''Set list of module names to try to load in forkserver process. ... raise ValueError('cannot find context for %r' % method) from None....
Read more >Multiprocessing Context in Python
In particular, locks created using the fork context cannot be passed to processes started using the spawn or forkserver start methods.
Read more >Using the multiprocessing Python Module - PyOxidizer
In this scenario, your application code should call multiprocessing. set_start_method("fork", force=True) before multiprocessing functionality is used.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I had exactly the same problem with Python 3.6.10 in VS Code on a Windows 10 machine. Could solve it by downgrading pandarallel to version 1.4.8.
As written in the Readme, do you use WSL?