Sunday, 15 September 2013

Python multiprocessing ImportError -



Python multiprocessing ImportError -

i’m having problem using python’s multiprocessing module. first time i’ve tried using module. i’ve tried simplifying processing bare bones, maintain getting same error. i’m using python 2.7.2, , windows 7.

the script i’m trying run called learnmp.py, , error message says problem can't find module learnmp.

import multiprocessing def dosomething(): """worker function""" print 'something' homecoming if __name__ == '__main__': jobs = [] in range(2): p = multiprocessing.process(target=dosomething) jobs.append(p) p.start()

the error :

file “<string>”, line 1, in <module> file “c:\python27\arcgisx6410.1\lib\multiprocessing\forking.py”, line 373, in main prepare(preparation_data) file “c:\python27\arcgisx6410.1\lib\multiprocessing\forking.py”, line 482, in prepare file, path_name, etc = imp.find_module (main_name, dirs) importerror: no module named learnmp

what’s causing error, , how can solve it?

edit: still don't know causing error, changing file name eliminated it.

looks might going downwards rabbit-hole looking multiprocessing. traceback shows, python install trying in arcgis version of python before looking @ scheme install.

my guess version of python ships arcgis customized reason or , can't find python script. question becomes:

why windows machine looking in arcgis python?

without looking @ machine @ lower level can't quite sure, if had guess, added arcgis directory path variable in front end of standard python directory, looks in arcgis first. if move arcgis path end of path variable should resolve problem.

changing path variable: http://www.computerhope.com/issues/ch000549.htm

python multiprocessing

No comments:

Post a Comment