简体   繁体   English

在命令行上调用时找到uWSGI模块,但在使用Emperor调用时找不到

[英]uWSGI module found when invoked on the command line but not when invoked using emperor

I have a python wsgi application which I am running under uWSGI. 我有一个在uWSGI下运行的python wsgi应用程序。

When I try to run the same application using emperor I get an error - 当我尝试使用Emperor运行相同的应用程序时,出现错误-

ImportError: No module named app_thing
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***

If I run uWSGI directly specifying the same config file that emperor is using it finds the module and the application works. 如果我运行uWSGI,直接指定皇帝正在使用的配置文件,它将找到该模块,并且该应用程序可以正常工作。

uWSGI config file below. 下面的uWSGI配置文件。

[uwsgi]
socket = 127.0.0.1:8000
workers = 1
force-cwd = /home/user/py
module = app_thing:application
protocol = http

Any help appreciated... 任何帮助表示赞赏...

Ok, turns out the fix involved setting the file rather than the module and also adding the dir to the python path in the uWSGI config. 好的,事实证明,该修复程序涉及设置文件而不是模块,以及将目录添加到uWSGI配置中的python路径。 Final config ended up as 最终配置结果为

    [uwsgi]
    socket = 127.0.0.1:8000
    workers = 1
    force-cwd = /home/py
    file = /home/py/app_thing.py
    pythonpath = /home/py

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM