A forum for general discussion of the Python programming language.


Postby honza » Sun Jun 09, 2013 1:07 pm

Good afternoon,

I have problem with basic example of multiprocessing. The, returns error and I do not know why. Problem you can see on picture and here is code:

from multiprocessing import Pool
p = Pool(5)
def f(x):
return x*x, [1,2,3])

Do you now where is a problem, please? Thank you and have a nice day.
error_multi.png (227.59 KiB) Viewed 872 times
Posts: 1
Joined: Sun Jun 09, 2013 12:54 pm

Re: multiprocessing

Postby Yoriz » Sun Jun 09, 2013 6:01 pm

It tells you right before that example that the following example will not work in the interactive interpreter.

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. For example:
Due to the reasons discussed here we will be moving to on October 1 2016
This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 1672
Joined: Fri Feb 08, 2013 1:35 am
Location: UK

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 5 guests