no python application found, check your startup logs for errors
来源:互联网 发布:suse11 yum安装包 编辑:程序博客网 时间:2024/06/06 01:56
最近在搭建服务器,版本是CentOS6.5,在测试uwsgi的安装是否正确的时候,就出现了问题,如题。
其中网上也查了下,有好多种方案,我也试过了大多方案,但是结果都是不可以的。
日志里面报类似于“Mon Mar 23 10:26:49 2015 – — no python application found, check your startup logs for errors —”这类错误时,需要好好检查一下xml文件这个文件里面行尾不能有空格,参数左右也不能有空格,这个问题坑了我一晚上!!!日志里面报类似于”ImportError: No module named wsgi”这类错误,需要检查一下你的xml文件的pythonpath选项在虚拟环境下,需要配置到uwsgi所在目录(非虚拟环境下,只需要配置到项目所在路径即可)
看到这里,我觉得问题应该如上面所说的那些,应该是出在配置文件的身上:
# yaml格式uwsgi: http: 0.0.0.0:80 chdir: /project_name_path module: project.wsgi processes: 4 listen : 100 daemonize: /tmp/uwsgi.log pidfile: /tmp/uwsgi.pid master: true disable-logging : true stats: /tmp/uwsgi.socket enable-threads: true buffer-size: 32768
我的配置文件,我用光标走了一遍,真的没有感觉到有空格的问题。但是我根据报错的信息(如题),可以判断应该是 配置文件中的chdir和module的问题,但是我又到服务器上再次确认了下,这个路径和项目的路径确实没有问题。
首先我发现这个问题的是这样的:
1.我在服务器上根据uwsgi的配置文件启动uwsgi,并无报错信息,然后我 ps aux | grep uwsgi
一下,并没有看到uwsgi的进程。意识到有问题。
2.然后我就查看uwsgi的日志/tmp/uwsgi.log
3.tail -f /tmp/uwsgi.log
动态查看日志,并发现如题报错。
然而,我只看了小半屏幕的日志,没有向上查看日志,后来偶然我想起上次出现问题的时候,也是因为只看了一小半的报错信息而漏掉了关键的提示。所以我果断将日志向上翻了翻,没想到,真的找到了问题的所在。
我看到日志中标记的启动uwsgi的时候,调用的是python2.6.6,系统默认的版本。但是我使用的是python2.7.9的版本啊,我做过相关的升级的,为什么还会用老的python版本呢?
看系统变量
我看了系统的环境变量PATH,其中有/usr/lib64/bin
路径(python2.6.6的),但是没有/usr/local/bin
路径(python2.7.9的),所以
去/etc/profile
里添加 export PATH=/usr/local/bin:$PATH
,退出登录,重新登录一下,再启动uwsgi就没有问题了。
回过头来,我们在来看下,为什么会报标题的错呢?因为我其实是在python2.6.6的基础上,又安装了python2.7.9,我只是做了软连接,并没有将python2.7.9的环境变量加入到系统的环境变量中,而我项目的环境、第三方包等都是安装到了python2.7.9的下面,启动uwsgi的时候,根据uwsgi的配置信息chdir和module找到项目的位置,但是加载代码的时候因为找不到第三方的库,出现大量的导入错误(上翻日志,一屏显示不下的,容易忽略错误),所以,uwsgi的配置文件module这步没有做通,导致的结果就是no python application found
,报这个错误就不稀奇了。
另一问题:我将uwsgi的配置文件中 http 换成 socket的时候,uwsgi服务是可以启动的,但是,并没有提供服务,浏览器是访问不到的。
- no python application found, check your startup logs for errors
- 使用 uwsgi + web.py 遇到 “--no python application found, check your startup logs for errors--”
- 使用 uwsgi + web.py 遇到 “--no python application found, check your startup logs for errors--”
- Check your hard disk for errors
- core libvlc error: No plugins found! Check your VLC installation.
- No suitable application records were found. Verify your bundle identifi
- redis shutdown (error) ERR Errors trying to SHUTDOWN. Check logs.
- redis 报(error) ERR Errors trying to SHUTDOWN. Check logs
- No MyBatis mapper was found in 'XXX' package. Please check your configuration
- No MyBatis mapper was found in '' package. Please check your configura, Could not autowire field
- , but no declaration can be found for element 'dubbo:application'.
- log4j:WARN No appenders could be found for logger (org.apache.catalina.startup.TldConfig).
- log4j warn no appenders could be found for logger org.apache.catalina.startup.embedded正解
- iOS:NO suitable application records were found.Verify your bundle identifier 'com***'is correct
- iOS No suitable application records were found. Verify your bundle identifier 'xxx' is correct.
- "Fatal Error[Cp001]: Copy protection check, No valid license found for this product [24] ".
- Action.c(33): Error -26377: No match found for the requested parameter "loginname". Check whether th
- IAR出现Copy protection check, No valid license found for this product的解决办法
- bzoj1069 [SCOI2007]最大土地面积(凸包+旋转卡壳)
- Excel在统计分析中的应用—第九章—非参数检验-独立性检验(x2统计量简化公式应用)
- java 中的方法
- 优秀的无线AP产品,改变你的工作感受
- 【数据库】基础知识要点
- no python application found, check your startup logs for errors
- 在Oracle中查询表的大小、表的占用情况和表空间的大小
- char和varchar的区别
- 关于搜狗浏览器打开github出现lease note that GitHub no longer supports your web browser.
- Python 字典(Dictionary) get()方法
- Ubuntu16.04安装R及RStudio
- 戏说系列-从生活例子看基于流量的架构设计
- Unity cache
- Oracle 查看表空间的大小及使用情况sql语句