This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dsdale24
Recipients Kain94, Rodrigue.Alcazar, amaury.forgeotdarc, asksol, dsdale24, jnoller, r.david.murray
Date 2011-04-20.22:45:05
SpamBayes Score 1.0444199e-07
Marked as misclassified No
Message-id <1303339506.21.0.967518498466.issue8094@psf.upfronthosting.co.za>
In-reply-to
Content
I think I have a similar situation:

C:\Py\Scripts\foo
---
if __name__ == '__main__':
    import bar
    bar.main()

C:\Py\Lib\site-packages\bar.py
---
from multiprocessing import Pool

def task(arg):
    return arg

def main():
    pool = Pool()
    res = pool.apply_async(task, (3.14,))

    print res.get()

if __name__ == '__main__':
    main()


I can run "python bar.py". "python C:\Py\Scripts\foo" yields an infinite stream of errors:

 File "<string>", line 1 in <module>
 File "C:\Python27\lib\multiprocessing\forking.py", line 346, in main
     prepare(preparation_data)
 File "C:\Python27\lib\multiprocessing\forking.py", line 455, in prepare
     file, path_name, etc = imp.find_module(main_name, dirs)
ImportError: No module named foo

This same scheme works fine on linux. Have I just overlooked something simple?
History
Date User Action Args
2011-04-20 22:45:06dsdale24setrecipients: + dsdale24, amaury.forgeotdarc, jnoller, r.david.murray, asksol, Kain94, Rodrigue.Alcazar
2011-04-20 22:45:06dsdale24setmessageid: <1303339506.21.0.967518498466.issue8094@psf.upfronthosting.co.za>
2011-04-20 22:45:05dsdale24linkissue8094 messages
2011-04-20 22:45:05dsdale24create