Multiprocessing: AttributeError: StdIn instance does not have the attribute 'close'

I get this error when multiprocessing while going through a simple range.

Process PoolWorker-37:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 249, in _bootstrap
    sys.stdin.close()
AttributeError: StdIn instance has no attribute 'close'

The code

pool = multiprocessing.Pool(processes=3)
pool.map(get_info, range(20000,20010), 1)
pool.close()
pool.join()

Update

the first problem was caused by a change in the eclipse environment, but now I get this error

PicklingError: Can't pickle <type 'cStringIO.StringO'>: attribute lookup cStringIO.StringO failed
+5
source share
2 answers

This error occurs if you are working in the PyCharm console. I used the system console and everything went fine.

+3
source

In PyCharm 4.5, the solution for me was to remove the "Show command line afterwards" checkbox in the Run / Debug server configuration for the python file (which is not even documented in the PyCharm manual)

+2
source

All Articles