celery 'Worker-n' pid:xxxx exited with 'exitcode 1' when I import hmmlearn

前端 未结 2 1720
深忆病人
深忆病人 2021-01-13 14:26

In my tasks.py file, when I import hmmlearn,

from hmmlearn import hmm

and start my celery workers, I get the following error



        
2条回答
  •  醉酒成梦
    2021-01-13 15:12

    I just stumbled upon a similar situation. Upgrading billiard to 3.5, as suggested in a different answer, was not an option (because it conflicts with Celery==3.1.25 and I prefer that particular version for Windows its support).

    I figured out, however, that in my case the problem was most probably due to this issue - it occurred only when I tried to import anything from sklearn in the Worker's process.

    The problem was resolved by adding this snippet before the imports from sklearn:

    from multiprocessing import current_process
    try:
        current_process()._config
    except AttributeError:
        current_process()._config = {'semprefix': '/mp'}
    

提交回复
热议问题