Multiprocessing working in Python but not in iPython

前端 未结 2 1150
情书的邮戳
情书的邮戳 2020-11-29 11:58

I am running the following code in iPython:

import multiprocessing

def my_function(x):
    \"\"\"The function you want to compute in parallel.\"\"\"
    x +         


        
2条回答
  •  时光取名叫无心
    2020-11-29 13:02

    From the documentation:

    Note

    Functionality within this package requires that the __main__ module be importable by the children. This is covered in Programming guidelines however it is worth pointing out here. This means that some examples, such as the multiprocessing.Pool examples will not work in the interactive interpreter

提交回复
热议问题