New submission from Matthias Bussonnier <[email protected]>:
$ python
Python 3.8.2 | packaged by conda-forge | (default, Apr 24 2020, 07:56:27)
[Clang 9.0.1 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from multiprocessing import Pool
>>>
>>> def f(x):
... return x*x
...
>>> with Pool(5) as p:
... print(p.map(f, [1, 2, 3]))
Process SpawnPoolWorker-1:
Process SpawnPoolWorker-2:
Process SpawnPoolWorker-3:
Traceback (most recent call last):
File
"/Users/bussonniermatthias/miniconda3/lib/python3.8/multiprocessing/process.py",
line 315, in _bootstrap
self.run()
File
"/Users/bussonniermatthias/miniconda3/lib/python3.8/multiprocessing/process.py",
line 108, in run
self._target(*self._args, **self._kwargs)
File
"/Users/bussonniermatthias/miniconda3/lib/python3.8/multiprocessing/pool.py",
line 114, in worker
task = get()
File
"/Users/bussonniermatthias/miniconda3/lib/python3.8/multiprocessing/queues.py",
line 358, in get
return _ForkingPickler.loads(res)
AttributeError: Can't get attribute 'f' on <module '__main__' (built-in)>
Traceback (most recent call last):
...
This is likely due to https://bugs.python.org/issue33725 (use spawn on MacOS),
we we can't use `fork()`.
----------
messages: 371900
nosy: mbussonn
priority: normal
severity: normal
status: open
title: Multiprocesing Pool borken on macOS REPL
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41041>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com