Use of multiprocessing in Python ends in ImportError

I try to run simple programs from a Python document using multiprocessing, but always get errors like:

Traceback (most recent call last):                               
  File "Poolexample.py", line 1, in <module>
    from multiprocessing import Pool
ImportError: cannot import name Pool

or similarly cannot import name Process. Does anyone know why Python is sending me such errors?

+5
source share
1 answer

Like @ahojnnes , multiprocessingwas introduced in Python 2.6 . So be sure to use Python 2.6+ if you need this module for painless integration.

However, you can use python-multiprocessing , which is backport multiprocessingfor Python 2.4 and 2.5.

+1
source

All Articles