Cannot use multiprocessing and zip together on windows


Leo Jay

Hi All,

I have a file, there is a in it, and the content of is:

from multiprocessing import Process
import os

def f():
print 'in f, pid:', os.getpid()

if __name__ == '__main__':
print 'pid:', os.getpid()
p = Process(target=f)

On linux, I can get expected result for running "python"
But on windows xp, I got:

Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\python27\lib\multiprocessing\", line 346, in main
File "C:\python27\lib\multiprocessing\", line 454, in prepare
assert main_name not in sys.modules, main_name
AssertionError: __main__

It seems that the situation described here is similar:

But the patch doesn't work for me.

Anybody knows how to fix this?


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question