-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
-
Is there a tutorial? I searched a lot but I couldn't find one. But running the optimizer gives the message For multiprocessing support in Backtest.optimize() set multiprocessing start method to 'fork'.
I am a Mac user.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions
See Contexts and Start Methods in Python multiprocessing
docs.
Replies: 3 comments 3 replies
-
See Contexts and Start Methods in Python multiprocessing
docs.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Thanks!
For anyone wondering, simply include this in your code:
import multiprocessing as mp mp.set_start_method('fork')
This only works on Unix systems.
Beta Was this translation helpful? Give feedback.
All reactions
-
tried this. getting: RuntimeError: context has already been set
Beta Was this translation helpful? Give feedback.
All reactions
-
You should run mp.set_start_method('fork')
only once when importing. Don't run it again.
Beta Was this translation helpful? Give feedback.
All reactions
-
import multiprocessing as mp try: # mp.set_start_method("spawn", force=True) # print("spawned") mp.set_start_method("fork", force=True) print("forked") except RuntimeError: pass
Beta Was this translation helpful? Give feedback.
All reactions
-
It works also on iOS (MacBook Pro)
Beta Was this translation helpful? Give feedback.