0

I'm trying to teach myself the basics of multiprocessing. As such, I found this example and decided to test it.

import multiprocessing

def worker():
    """worker function"""
    print 'Worker'
    return

if __name__ == '__main__':
    jobs = []
    for i in range(5):
        p = multiprocessing.Process(target=worker)
        jobs.append(p)
        p.start()
        p.join()

It works in the python IDLE, but eventually I need to run code in the IDE for a program called vizard. However, when I do so I get this error:

Traceback (most recent call last): File "", line 11, in IOError: [Errno 2] No such file or directory: u'C:\Users\dbak\Documents\from multiprocessing.forking import main; main()'

It seems like the IDE is looking for forking.py, but I'm unsure as to how I can 'help' it find it. I did put the multiprocessing folder in the same folder the program saved in, but I found that this is still flawed. Does anyone know how I might resolve this error?

  • 1
    After reading pyInTheSky's answer, I found this link was also helpful. http://stackoverflow.com/q/765129/1496630 – user1496630 Jul 31 '12 at 17:32

1 Answers1

0

Please check out:

http://docs.python.org/library/multiprocessing.html#windows

16.6.3.2 Comments on windows

pyInTheSky
  • 1,459
  • 1
  • 9
  • 24