Igor Jurkowski
Igor Jurkowski

Reputation: 51

Using multiprocessing in Python ends in ImportError

I'm trying to run simple programs from Python doc using multiprocessing, however I 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. Anyone knows why does Python send me such errors?

Upvotes: 5

Views: 4440

Answers (1)

orftz
orftz

Reputation: 1148

As @ahojnnes said, multiprocessing was introduced in Python 2.6. So, be sure to use Python 2.6+ if you need this module with painless integration.

However, you could use python-multiprocessing, which is a backport of multiprocessing for Python 2.4 and 2.5.

Upvotes: 1

Related Questions