Message371900
$ 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()`. |
|
Date |
User |
Action |
Args |
2020-06-19 21:00:05 | mbussonn | set | recipients:
+ mbussonn |
2020-06-19 21:00:05 | mbussonn | set | messageid: <1592600405.92.0.621654131969.issue41041@roundup.psfhosted.org> |
2020-06-19 21:00:05 | mbussonn | link | issue41041 messages |
2020-06-19 21:00:05 | mbussonn | create | |
|