uswgi-无法从multiprocessing.semaphore_tracker加载配置 [英] uswgi - Unable to load configuration from from multiprocessing.semaphore_tracker

查看:715
本文介绍了uswgi-无法从multiprocessing.semaphore_tracker加载配置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前,我正在将Flask应用程序部署到Ubuntu服务器(AWS).当我尝试启动uwsgi服务器并使用journalctl查找日志时,我注意到一种警告/错误.

Currently i'm deploying my Flask application to an Ubuntu server (AWS). When I try to start the uwsgi server and look with journalctl to the logs I notice a kind of warning/error.

我可以忽略它吗?我不知道如何解决它或它来自哪里.现在已经坚持了2天.谁可以帮助我?

Can I ignore it? I don't know how to solve it or where it came from. Stuck on this for 2 days right now. Who can help me?

错误:

 *** Operational MODE: preforking ***
Jan 04 15:27:11 ip-172-31-39-12 uwsgi[21781]: unable to load configuration from from multiprocessing.semaphore_tracker import main;main(10)

推荐答案

在我的情况下,此错误是由于将uWSGI 2.0.17.1与Flask 1.0.2和scikit-learn 0.20.0一起使用的.

In my case this error was due to using uWSGI 2.0.17.1 with Flask 1.0.2 and scikit-learn 0.20.0.

在内部,scikit-learn导入joblib,该lib在导入时试图产生信号量跟踪过程(sklearn/externals/joblib/_multiprocessing_helpers.py).

Internally, scikit-learn imports joblib which, at import time, tries to spawn a semaphore tracking process (sklearn/externals/joblib/_multiprocessing_helpers.py).

通过生成具有当前可执行文件名称的命令并附加-c'from multiprocessing.semaphore_tracker import main; main(fd)" 来产生信号量跟踪过程.

The semaphore tracking process is spawned by generating a command with the name of the current executable and appending "-c 'from multiprocessing.semaphore_tracker import main;main(fd)".

当前可执行文件的名称应为"python",但使用uWSGI时并非如此.结果命令为"/usr/local/bin/uwsgi -c'from multiprocessing.semaphore_tracker import main; main(fd)" ,该命令失败并输出上述错误消息.

The name of the current executable is expected to be 'python' but this is not so when using uWSGI. The resulting command is "/usr/local/bin/uwsgi -c 'from multiprocessing.semaphore_tracker import main;main(fd)" which fails and outputs the above error message.

此处所述,一种解决方法是设置环境变量JOBLIB_MULTIPROCESSING = 0

A workaround, as documented here is to set the environment variable JOBLIB_MULTIPROCESSING=0.

请注意,在我的情况下,这样做的唯一后果是生成了一个已失效的uWSGI进程,该进程最终被清理了.

Note that the only consequence of this, in my situation, was to generate a defunct uWSGI process that was eventually cleaned up.

这篇关于uswgi-无法从multiprocessing.semaphore_tracker加载配置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆