简体   繁体   English

ladon + uwsgi:无法加载应用

[英]ladon + uwsgi: unable to load app

I am using to publish some API (soap) over the internet. 我用来通过互联网发布一些API(肥皂)。 I would like to use nginx + uwsgi but I am in trouble: I get this output browsing to the page offered by the uwsgi binary: 我想使用nginx + uwsgi,但遇到麻烦了:我浏览到uwsgi二进制文件提供的页面时得到以下输出:

Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/ladon/server/wsgi_application.py", line 332, in __call__
self.import_services(self.service_list)
 File "/usr/local/lib/python2.7/dist-packages/ladon/server/wsgi_application.py", line 288, in import_services
__import__(service)
 ImportError: No module named serverL

My CLI is: 我的CLI是:

uwsgi -s 127.0.0.1:7777 --logto ~/uwsgi.log --wsgi-file /path/scripts/handler.py

handler.py contains: handler.py包含:

from ladon.server.wsgi import LadonWSGIApplication
from os.path import abspath,dirname

application = LadonWSGIApplication('serverL','/path/script/src')

and my tree in /path/script: 和我的树在/ path / script中:

.
├── handler.py
├── src
│   ├── serverL.py

Thanks in advance 提前致谢

I strongly suggest you to invest some time in understanding PYTHONPATH/sys.path, is one of the most important aspect of the python world but lot of users underestimate it (and you can note how it is one of the most prominent cause for errors during deployment). 我强烈建议您花一些时间来理解PYTHONPATH / sys.path,这是python世界中最重要的方面之一,但是很多用户都低估了它(您可以注意到它是导致错误的最主要原因之一)部署)。

Your problem is that the python VM has no way to know where serverL module is, so you should add '/path/script/src' to the pythonpath (you have various way to do it, the fastest is using the --pythonpath uWSGI option) 您的问题是python虚拟机无法知道serverL模块在哪里,因此您应该在pythonpath中添加“ / path / script / src”(您可以使用多种方法,最快的方法是使用--pythonpath uWSGI选项)

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

相关问题 无法加载应用0(mountpoint ='') - 带有uwsgi的Flask应用 - unable to load app 0 (mountpoint='') - Flask app with uwsgi 我在uwsgi上运行Django时无法加载app 0错误 - I get unable to load app 0 error while running django on uwsgi Flask 和 uWSGI - 无法加载应用程序 0 (mountpoint='')(找不到可调用或导入错误) - Flask and uWSGI - unable to load app 0 (mountpoint='') (callable not found or import error) 为什么我的python文件返回无法在uwsgi烧瓶中加载应用程序? - Why my python file returns unable to load app in uwsgi flask? Flask / uWSGI引发错误,无法加载应用0(mountpoint =”) - Flask/uWSGI throws error unable to load app 0 (mountpoint='') 无法加载应用0(mountpoint ='uwsgi')(找不到可调用或导入错误) - unable to load app 0 (mountpoint='uwsgi') (callable not found or import error) 无法从 uwsgi 加载配置 - unable to load configuration from uwsgi 需要在UWSGI中加载多个应用 - Need to Load multiple App in UWSGI uwsgi-nginx-flask: 无法加载应用程序 0 (mountpoint='') (callable not found or import error) - uwsgi-nginx-flask: unable to load app 0 (mountpoint='') (callable not found or import error) 尝试通过 uwsg 运行 Flask 应用程序时无法从 uwsgi 加载配置 - unable to load configuration from uwsgi when attempting to run flask app via uwsg
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM