我正在将应用程序部署到heroku,但它永远不会成功。一切似乎都在线,所以我无法弄清楚为什么它拒绝启动。这是heroku日志:
2017-07-08T13:52:55.000000+00:00 app[api]: Build succeeded
2017-07-08T13:53:15.826287+00:00 heroku[web.1]: State changed from crashed to starting
2017-07-08T13:53:20.646146+00:00 heroku[web.1]: Starting process with command `gunicorn app:app`
2017-07-08T13:53:22.750972+00:00 app[web.1]: [2017-07-08 13:53:22 +0000] [4] [INFO] Starting gunicorn 19.6.0
2017-07-08T13:53:22.751523+00:00 app[web.1]: [2017-07-08 13:53:22 +0000] [4] [INFO] Listening at: http://0.0.0.0:27841 (4)
2017-07-08T13:53:22.751640+00:00 app[web.1]: [2017-07-08 13:53:22 +0000] [4] [INFO] Using worker: sync
2017-07-08T13:53:22.756847+00:00 app[web.1]: [2017-07-08 13:53:22 +0000] [9] [INFO] Booting worker with pid: 9
2017-07-08T13:53:22.759355+00:00 app[web.1]: [2017-07-08 13:53:22 +0000] [10] [INFO] Booting worker with pid: 10
2017-07-08T13:53:22.759397+00:00 app[web.1]: [2017-07-08 13:53:22 +0000] [9] [ERROR] Exception in worker process
2017-07-08T13:53:22.759398+00:00 app[web.1]: Traceback (most recent call last):
2017-07-08T13:53:22.759399+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
2017-07-08T13:53:22.759400+00:00 app[web.1]: worker.init_process()
2017-07-08T13:53:22.759401+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
2017-07-08T13:53:22.759401+00:00 app[web.1]: self.load_wsgi()
2017-07-08T13:53:22.759402+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
2017-07-08T13:53:22.759403+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2017-07-08T13:53:22.759404+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2017-07-08T13:53:22.759405+00:00 app[web.1]: self.callable = self.load()
2017-07-08T13:53:22.759406+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2017-07-08T13:53:22.759406+00:00 app[web.1]: return self.load_wsgiapp()
2017-07-08T13:53:22.759407+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2017-07-08T13:53:22.759408+00:00 app[web.1]: return util.import_app(self.app_uri)
2017-07-08T13:53:22.759409+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2017-07-08T13:53:22.759409+00:00 app[web.1]: __import__(module)
2017-07-08T13:53:22.759410+00:00 app[web.1]: ImportError: No module named app
2017-07-08T13:53:22.759481+00:00 app[web.1]: [2017-07-08 13:53:22 +0000] [9] [INFO] Worker exiting (pid: 9)
2017-07-08T13:53:22.761330+00:00 app[web.1]: [2017-07-08 13:53:22 +0000] [10] [ERROR] Exception in worker process
2017-07-08T13:53:22.761331+00:00 app[web.1]: Traceback (most recent call last):
2017-07-08T13:53:22.761332+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 557, in spawn_worker
2017-07-08T13:53:22.761333+00:00 app[web.1]: worker.init_process()
2017-07-08T13:53:22.761334+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process
2017-07-08T13:53:22.761334+00:00 app[web.1]: self.load_wsgi()
2017-07-08T13:53:22.761335+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/workers/base.py", line 136, in load_wsgi
2017-07-08T13:53:22.761335+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2017-07-08T13:53:22.761336+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
2017-07-08T13:53:22.761337+00:00 app[web.1]: self.callable = self.load()
2017-07-08T13:53:22.761338+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load
2017-07-08T13:53:22.761338+00:00 app[web.1]: return self.load_wsgiapp()
2017-07-08T13:53:22.761339+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp
2017-07-08T13:53:22.761340+00:00 app[web.1]: return util.import_app(self.app_uri)
2017-07-08T13:53:22.761340+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/util.py", line 357, in import_app
2017-07-08T13:53:22.761341+00:00 app[web.1]: __import__(module)
2017-07-08T13:53:22.761341+00:00 app[web.1]: ImportError: No module named app
2017-07-08T13:53:22.761438+00:00 app[web.1]: [2017-07-08 13:53:22 +0000] [10] [INFO] Worker exiting (pid: 10)
2017-07-08T13:53:22.778351+00:00 app[web.1]: Traceback (most recent call last):
2017-07-08T13:53:22.778355+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 11, in <module>
2017-07-08T13:53:22.778381+00:00 app[web.1]: sys.exit(run())
2017-07-08T13:53:22.778382+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 74, in run
2017-07-08T13:53:22.778409+00:00 app[web.1]: WSGIApplication("%(prog)s [OPTIONS] [APP_MODULE]").run()
2017-07-08T13:53:22.778410+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 192, in run
2017-07-08T13:53:22.778455+00:00 app[web.1]: super(Application, self).run()
2017-07-08T13:53:22.778456+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/app/base.py", line 72, in run
2017-07-08T13:53:22.778475+00:00 app[web.1]: Arbiter(self).run()
2017-07-08T13:53:22.778476+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 218, in run
2017-07-08T13:53:22.778526+00:00 app[web.1]: self.halt(reason=inst.reason, exit_status=inst.exit_status)
2017-07-08T13:53:22.778526+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 331, in halt
2017-07-08T13:53:22.778574+00:00 app[web.1]: self.stop()
2017-07-08T13:53:22.778574+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 381, in stop
2017-07-08T13:53:22.778626+00:00 app[web.1]: time.sleep(0.1)
2017-07-08T13:53:22.778627+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 231, in handle_chld
2017-07-08T13:53:22.778672+00:00 app[web.1]: self.reap_workers()
2017-07-08T13:53:22.778673+00:00 app[web.1]: File "/app/.heroku/python/lib/python2.7/site-packages/gunicorn/arbiter.py", line 506, in reap_workers
2017-07-08T13:53:22.778739+00:00 app[web.1]: raise HaltServer(reason, self.WORKER_BOOT_ERROR)
2017-07-08T13:53:22.778777+00:00 app[web.1]: gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>
2017-07-08T13:53:22.848122+00:00 heroku[web.1]: Process exited with status 1
2017-07-08T13:53:22.858072+00:00 heroku[web.1]: State changed from starting to crashed
我的文件结构如下:
黄色标记的文件夹是我的虚拟环境,当我尝试推动时我已经激活了它。
控制台如下所示:
感谢您了解这种情况发生的原因,或者我如何诊断问题!我唯一的问题是为什么控制台显示python 2.7时app和虚拟环境都是python 3 ...