Python - multiprocessing assertionError

Lettcue with Python (< 2.7.11): multiprocessing\ AssertionError: main

Issue: There’s an AssertionError when I try to test some mutliprocessing features using lettuce 0.2.22 and python 2.7.10 error details:

File "<string>", line 1, in <module>
File "C:\Python27\Lib\multiprocessing\", line 380, in main
  File "C:\Python27\Lib\multiprocessing\", line 488, in prepare
    assert main_name not in sys.modules, main_name
AssertionError: __main__


  • upgrade to python 2.7.11 becuase this is a fixed bug:; or
  • use a wrapper (.py file name should be not in sys.modules, main_name):
__requires__ = 'lettuce==0.2.20'
import sys
from pkg_resources import load_entry_point

if __name__ == '__main__':
        load_entry_point('lettuce==0.2.20', 'console_scripts', 'lettuce')()
- 2016-03-21 edit