- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
嗨,我正在学习本教程 https://semaphoreci.com/community/tutorials/dockerizing-a-python-django-web-application关于如何在 docker 上部署一个 Django 项目,在某些时候你必须开始使用 gunicorn
我的 start.sh 是这样的。
#!/bin/bash
#start gunicorn processes
echo "starting gunicorn for wrappers"
exec gunicorn sparqlwrapper.wsgi.application --bind 0.0.0.0:8000 --workers 5
starting gunicorn for wrappers
[2017-09-28 12:47:05 +0000] [28740] [INFO] Starting gunicorn 19.7.1
[2017-09-28 12:47:05 +0000] [28740] [INFO] Listening at: http://0.0.0.0:8000 (28740)
[2017-09-28 12:47:05 +0000] [28740] [INFO] Using worker: sync
[2017-09-28 12:47:05 +0000] [28745] [INFO] Booting worker with pid: 28745
[2017-09-28 12:47:05 +0000] [28746] [INFO] Booting worker with pid: 28746
[2017-09-28 12:47:05 +0000] [28747] [INFO] Booting worker with pid: 28747
[2017-09-28 12:47:05 +0000] [28745] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 578, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 135, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 352, in import_app
__import__(module)
ImportError: No module named application
[2017-09-28 12:47:05 +0000] [28745] [INFO] Worker exiting (pid: 28745)
[2017-09-28 12:47:05 +0000] [28746] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 578, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 135, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 352, in import_app
__import__(module)
ImportError: No module named application
[2017-09-28 12:47:05 +0000] [28746] [INFO] Worker exiting (pid: 28746)
Traceback (most recent call last):
File "/usr/local/bin/gunicorn", line 11, in <module>
sys.exit(run())
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 74, in run
WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 203, in run
super(Application, self).run()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 72, in run
Arbiter(self).run()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 231, in run
self.halt(reason=inst.reason, exit_status=inst.exit_status)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 344, in halt
self.stop()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 393, in stop
time.sleep(0.1)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 244, in handle_chld
self.reap_workers()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 524, in reap_workers
raise HaltServer(reason, self.WORKER_BOOT_ERROR)
gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
[2017-09-28 12:47:05 +0000] [28747] [ERROR] Exception in worker process
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/gunicorn/arbiter.py", line 578, in spawn_worker
worker.init_process()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 126, in init_process
self.load_wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/workers/base.py", line 135, in load_wsgi
self.wsgi = self.app.wsgi()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/base.py", line 67, in wsgi
self.callable = self.load()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 65, in load
return self.load_wsgiapp()
File "/usr/local/lib/python2.7/dist-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
return util.import_app(self.app_uri)
File "/usr/local/lib/python2.7/dist-packages/gunicorn/util.py", line 352, in import_app
__import__(module)
ImportError: No module named application
[2017-09-28 12:47:05 +0000] [28747] [INFO] Worker exiting (pid: 28747)
最佳答案
application
对象不是模块;您应该使用冒号而不是句点将其与所在的模块分开。
exec gunicorn sparqlwrapper.wsgi:application --bind 0.0.0.0:8000 --workers 5
关于python - Gunicorn ImportError : No module named application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46466380/
如何根据可用性使用有时像这样导入的不同模块运行相同的测试: try: from gevent.local import local except ImportError
我在使用 Nose 运行我的单元测试时遇到了一个ImportError,而当我单独运行它时却没有。此处提及的所有文件均可在 http://gist.github.com/395541# 中查看. 如果
当我在一个Python程序中导入熊猫时,我收到以下错误。这里也是程序:
我想下载Spacy,但终端的打字扩展版本降低了:。接下来,我想安装语言包python-m spacy Download en,但出现另一个错误:。我当前的python版本是3.7,我应该更新它吗?或者
我想下载Spacy,但终端的打字扩展版本降低了:。接下来,我想安装语言包python-m spacy Download en,但出现另一个错误:。我当前的python版本是3.7,我应该更新它吗?或者
Traceback (most recent call last): File "c:\users\sathish.pv\appdata\local\continuum\anaconda3\lib
我已经编写了一个名为coinview.py的脚本,它可以在Linux上运行。当我尝试以SYSTEM D身份运行它时,出现错误。错误:ImportError:没有名为‘Schedule’的模块。。我用的
这是我的错误信息 Traceback (most recent call last): File "app.py", line 9, in from forms import Conta
我正在使用 Mac OS x 10.10.3 Yosemite 和 Python 2.7.9 |Anaconda 2.2.0 (x86_64) 来处理很多 python 的东西。我正在使用 Eclip
我是 Django 新手,正在创建我的第一个项目。一切正常,突然出现 ImportError('win32 only') ImportError: win32.在网上搜索了很多,但没有找到解决方案。
回复 a similar question建议我不能以独立模式导入 Shell 的东西。但是,据我了解,St 是一个用 C 编写的单独库。但我仍然无法在 gjs 中导入它...... IE。 $ gj
好吧,我被这个难住了。我环顾四周,但找不到任何东西,也不知道如何调试它。基本上,python 在我未导入任何内容的代码行中抛出一个 ImportError。我有一个相当大的模块 ICgen,其中包含模
我正在调用 psycopg2 import psycopg2 我得到标准错误 ImportError: No module named psycopg2 我用 macports 安装了我的副本,所以我
我已经使用 brew 安装了 opencv3,但是在执行 import cv2 时遇到了 importError >>> import cv2 Traceback (most recent call
安装numpy表示已经是最新版本,出现在pip list返回的列表中也是,但是导入它会产生导入错误(并且这个问题对于每个其他已安装的模块都存在,例如 scipy、matplotlib)。 系统有什么问
我有一个 python 脚本,运行时会产生以下错误: import urllib2 File "C:\Python27\lib\urllib2.py", line 94, in import htt
我正在尝试运行 this tutorial在合作实验室。 但是,当我尝试导入一堆模块时: import io import torch from torchtext.utils import down
我在这里遇到了一个特别棘手的问题。 我目前正在做一个个人项目,从一个相对简单的 Riot API 包装器开始,一切都运行良好,直到我想打包它并组织模块。这是该项目的链接:Logistic Analys
我已经通过easy_install.py --upgrade google-api-python-client安装了适用于Python的Google API客户端库。当我运行包含from oauth2
我正在使用 Django,并且我的组应用程序不断收到此错误,我检查了所有导入设置,一切都很好。我的注册和个人资料应用程序运行顺利,但为什么这个应用程序给我一个 ImportError 模型? Trac
我是一名优秀的程序员,十分优秀!