Error while deploying on Heroku

Hi. I am making a Dash app and using Heroku for deployment. I’ve been trying to deploy it for so long but it shows the following error.
2019-06-26T07:24:54.619101+00:00 app[web.1]: Traceback (most recent call last):
2019-06-26T07:24:54.619129+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py”, line 583, in spawn_worker
2019-06-26T07:24:54.619132+00:00 app[web.1]: worker.init_process()
2019-06-26T07:24:54.619134+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py”, line 129, in init_process
2019-06-26T07:24:54.619136+00:00 app[web.1]: self.load_wsgi()
2019-06-26T07:24:54.619138+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py”, line 138, in load_wsgi
2019-06-26T07:24:54.619140+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2019-06-26T07:24:54.619142+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py”, line 67, in wsgi
2019-06-26T07:24:54.619145+00:00 app[web.1]: self.callable = self.load()
2019-06-26T07:24:54.619146+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py”, line 52, in load
2019-06-26T07:24:54.619148+00:00 app[web.1]: return self.load_wsgiapp()
2019-06-26T07:24:54.619150+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py”, line 41, in load_wsgiapp
2019-06-26T07:24:54.619152+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-06-26T07:24:54.619154+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py”, line 350, in import_app
2019-06-26T07:24:54.619156+00:00 app[web.1]: import(module)
2019-06-26T07:24:54.619165+00:00 app[web.1]: ModuleNotFoundError: No module named ‘app’
2019-06-26T07:24:54.619356+00:00 app[web.1]: [2019-06-26 07:24:54 +0000] [10] [INFO] Worker exiting (pid: 10)
2019-06-26T07:24:54.678044+00:00 app[web.1]: [2019-06-26 07:24:54 +0000] [4] [INFO] Shutting down: Master
2019-06-26T07:24:54.678274+00:00 app[web.1]: [2019-06-26 07:24:54 +0000] [4] [INFO] Reason: Worker failed to boot.
2019-06-26T07:25:00.000000+00:00 app[api]: Build succeeded
2019-06-26T07:25:18.401063+00:00 heroku[web.1]: Starting process with command gunicorn app:server
2019-06-26T07:25:20.645695+00:00 heroku[web.1]: State changed from starting to crashed
2019-06-26T07:25:20.624583+00:00 heroku[web.1]: Process exited with status 3
2019-06-26T07:25:20.470276+00:00 app[web.1]: [2019-06-26 07:25:20 +0000] [4] [INFO] Starting gunicorn 19.9.0
2019-06-26T07:25:20.470989+00:00 app[web.1]: [2019-06-26 07:25:20 +0000] [4] [INFO] Listening at: http://0.0.0.0:59597 (4)
2019-06-26T07:25:20.471166+00:00 app[web.1]: [2019-06-26 07:25:20 +0000] [4] [INFO] Using worker: sync
2019-06-26T07:25:20.475944+00:00 app[web.1]: [2019-06-26 07:25:20 +0000] [10] [INFO] Booting worker with pid: 10
2019-06-26T07:25:20.481633+00:00 app[web.1]: [2019-06-26 07:25:20 +0000] [10] [ERROR] Exception in worker process
2019-06-26T07:25:20.481636+00:00 app[web.1]: Traceback (most recent call last):
2019-06-26T07:25:20.481639+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/arbiter.py”, line 583, in spawn_worker
2019-06-26T07:25:20.481641+00:00 app[web.1]: worker.init_process()
2019-06-26T07:25:20.481643+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py”, line 129, in init_process
2019-06-26T07:25:20.481645+00:00 app[web.1]: self.load_wsgi()
2019-06-26T07:25:20.481647+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/workers/base.py”, line 138, in load_wsgi
2019-06-26T07:25:20.481649+00:00 app[web.1]: self.wsgi = self.app.wsgi()
2019-06-26T07:25:20.481652+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/base.py”, line 67, in wsgi
2019-06-26T07:25:20.481654+00:00 app[web.1]: self.callable = self.load()
2019-06-26T07:25:20.481656+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py”, line 52, in load
2019-06-26T07:25:20.481658+00:00 app[web.1]: return self.load_wsgiapp()
2019-06-26T07:25:20.481663+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/app/wsgiapp.py”, line 41, in load_wsgiapp
2019-06-26T07:25:20.481665+00:00 app[web.1]: return util.import_app(self.app_uri)
2019-06-26T07:25:20.481667+00:00 app[web.1]: File “/app/.heroku/python/lib/python3.6/site-packages/gunicorn/util.py”, line 350, in import_app
2019-06-26T07:25:20.481669+00:00 app[web.1]: import(module)
2019-06-26T07:25:20.481710+00:00 app[web.1]: ModuleNotFoundError: No module named ‘app’
2019-06-26T07:25:20.481814+00:00 app[web.1]: [2019-06-26 07:25:20 +0000] [10] [INFO] Worker exiting (pid: 10)
2019-06-26T07:25:20.518855+00:00 app[web.1]: [2019-06-26 07:25:20 +0000] [4] [INFO] Shutting down: Master
2019-06-26T07:25:20.519005+00:00 app[web.1]: [2019-06-26 07:25:20 +0000] [4] [INFO] Reason: Worker failed to boot.
2019-06-26T07:26:50.184549+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/" host=app-is-new.herokuapp.com request_id=efcf24fb-6b6c-4911-883e-ea98797e4543 fwd=“115.113.127.77” dyno= connect= service= status=503 bytes= protocol=http
2019-06-26T07:27:32.897277+00:00 heroku[router]: at=error code=H10 desc=“App crashed” method=GET path="/" host=app-is-new.herokuapp.com request_id=eade51d5-8769-4846-b5d8-6c362215455a fwd=“115.113.127.77” dyno= connect= service= status=503 bytes= protocol=http

It says for no module named ‘app’ but I haven’t used app anywhere and it’s my app that is named app.py

Can anyone help me out? Thank you! :slight_smile:

Is gunicorn in your requirements file? Often when i use :

pip freeze > requirements.txt

gunicorn is not inside, so heroku does not install and that might be the problem.

1 Like

Hi. Thank you for your reply.

Yes. Gunicorn is in my requirements file.