Python: multiprocessing assertionError

Categories: Development NotesPython; Tagged with: ; @ March 22nd, 2016 23:32

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

multiprocessing\ AssertionError: main
File "", line 1, in 
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')()

// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.