Multiprocessing program has AttributeError in Anaconda notebook

前端 未结 1 1863
Happy的楠姐
Happy的楠姐 2020-12-20 18:54

I am running a simple \"Hello World\" program on Windows 7 64 bit with the following specifications:

Python 3.4.3 | Anaconda 2.3.0 (64-bit) | [MSC v.1600 64          


        
1条回答
  •  佛祖请我去吃肉
    2020-12-20 19:14

    This is because of the fact that multiprocessing does not work well in the interactive interpreter. The main reason is that there is no fork() function applicable in windows. It is explained on their web page itself.

    "Functionality within this package requires that the main module must 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."

    https://docs.python.org/2/library/multiprocessing.html#windows

    This same problem will come if you are using pool function in multiprocessing. It is solved in this post . You can hence use that method for executing your idea of parallel processing.

    Python multiprocessing apply_async never returns result on Windows 7

    Hope it is a useful information to you.

    0 讨论(0)
提交回复
热议问题