[IPython-User] Multiprocessing Pool woes

MinRK benjaminrk@gmail....
Tue Feb 11 14:47:58 CST 2014

To start off, I would generally recommend against using multiprocessing on
Windows, if you can avoid it. It doesn't work reliably, due to Windows'
lack of a real process fork. There are various workarounds for its many
peculiarities, but there will always be 'multiprocessing woes' on Windows.
But on to answering your actual question, I need a bit more information:

Are you using plain terminal IPython, or `ipython console` or the qtconsole
or the notebook? There are some multiprocessing issues with IPython on
Windows in the IPython kernel (used by the notebook, zmq console, etc.)
that have been fixed in master, but I think not 1.1. And what version of
IPython are you using?


On Tue, Feb 11, 2014 at 7:32 AM, pbr <tim.pierson@gmail.com> wrote:

> I've seen this problem reported on stackoverflow, but I can't seem to find
> a
> solution.  (And I see that other IPython users don't seem to encounter it,
> so I thought I'd ask).  I'm on windows 7 64 (32bit python 2.7.6) and the
> following Multiprocessing Pool test returns a timeout error:
> from multiprocessing import Pool
> def f(x):
>     return x*x
> if __name__ == '__main__':
>     pool = Pool(processes=4)              # start 4 worker processes
>     result = pool.apply_async(f, [10])    # evaluate "f(10)" asynchronously
>     print result.get(timeout=1)           # prints "100" unless your
> computer is *very* slow
>     print pool.map(f, range(10))          # prints "[0, 1, 4,..., 81]"
> All other multiprocessing tests also throw errors (sometimes in console:
> running function f() writes: Attribute error "module" has to attribute 'f')
> Is there a way to use multiprocessing on windows in ipython?
> Thanks
> --
> View this message in context:
> http://python.6.x6.nabble.com/Multiprocessing-Pool-woes-tp5047050.html
> Sent from the IPython - User mailing list archive at Nabble.com.
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20140211/e294def3/attachment.html 

More information about the IPython-User mailing list