首页 > 解决方案 > brew 在 m1 monterey mac 上安装了 uwsgi 不加载应用程序

问题描述

我已经使用 brew 在我的 macbook(macOS monterey - m1 芯片)上安装了 uwsgi。我的 main.py 看起来像这样:

app = Flask("my_app")
import routing # implemented routes in this module

我的 uwsgi.ini 文件如下所示:

[uwsgi]
module = main:app
master = true
http-socket = :8081
processes = 4

当我跑步时

$ uwsgi --ini uwsgi.ini

这会发生:

.
.
.
*** Operational MODE: preforking ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!
no request plugin is loaded, you will not be able to manage requests.
you may need to install the package for your language of choice, or simply load it with --plugin.
!!!!!!!!!!! END OF WARNING !!!!!!!!!!
spawned uWSGI master process (pid: 95857)
spawned uWSGI worker 1 (pid: 95858, cores: 1)
spawned uWSGI worker 2 (pid: 95859, cores: 1)
spawned uWSGI worker 3 (pid: 95860, cores: 1)
spawned uWSGI worker 4 (pid: 95861, cores: 1)

我以前在大苏尔可以做到这一点,但现在在蒙特雷,它的表现很奇怪。(pip install uwsgi 也会导致错误,在另一篇文章中询问)

标签: pythonhomebrewuwsgiapple-m1macos-monterey

解决方案


您已经编译了没有任何内置请求插件的 uWSGI,也没有指示它加载一个。

假设您的 Python 应用程序位于 virtualenv 中(为什么不呢?!),pip install uwsgi在该 virtualenv 中运行(您可能需要使用 eg --ignore-installed);它足够聪明,可以在 Python 插件中为 virtualenv 的解释器版本编译。


推荐阅读