Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Beginner Multiprocessing Question

$
0
0
I'm trying to run a really simple multiprocessing script but I get an error that says "AttributeError: 'module' object has no attribute 'f'. *See script below. Every time I try to run any sample script w/ a multiprocessing process, I get the same error. I'm on Windows 7, with the stock Python 2.6 install that comes with ArcMap 10.0. I also tried this on a machine with 10.1 and Python 2.7 and got the same error.

I got the script from here:

http://docs.python.org/2/library/multiprocessing.html

*The script is:

******
from multiprocessing import Process

def f(name):
print 'hello', name

if __name__ == '__main__':
p = Process(target=f, args=('bob',))
p.start()
p.join()
*******

Full error output
Traceback (most recent call last):
FIle "(string)", line 1, in (module)
File "C\Python26\ArcGIS10.0\lib\pickle.p",line 1370, in load
return Unpickler(file).load()
File ""C\Python26\ArcGIS10.0\lib\pickle.p",line 858, in load
dispatch[key](self)
"C\Python26\ArcGIS10.0\lib\pickle.p",line 1090, in load_global
klass = self.find_class(module,name)
"C\Python26\ArcGIS10.0\lib\pickle.p",line 1126, in find_class
klass = getattr(mod,name)
AttributeError: 'module' object has no attribute 'f'

Viewing all articles
Browse latest Browse all 2485

Trending Articles