I have been trying to upload a flask application l create to the heroku server. l get this message when l try to run the application. l am still new at this.
l am using a win10 computer, with python 3 and conda env installed
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command heroku logs --tail
after checking the logs l got this
20-04-04T18:51:29.486263+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 971, in _find_and_load
2020-04-04T18:51:29.486263+00:00 app[web.1]: File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked
2020-04-04T18:51:29.486382+00:00 app[web.1]: ModuleNotFoundError: No module named 'app'
2020-04-04T18:51:29.486687+00:00 app[web.1]: [2020-04-04 18:51:29 +0000] [11] [INFO] Worker exiting (pid: 11)
2020-04-04T18:51:29.599281+00:00 app[web.1]: [2020-04-04 18:51:29 +0000] [4] [INFO] Shutting down: Master
2020-04-04T18:51:29.599441+00:00 app[web.1]: [2020-04-04 18:51:29 +0000] [4] [INFO] Reason: Worker failed to boot.
2020-04-04T19:00:27.000000+00:00 app[api]: Build started by user tbmakusha@gmail.com
2020-04-04T19:05:27.000000+00:00 app[api]: Build failed -- check your build output: https://dashboard.heroku.com/apps/8e82c830-7360-4f12-8ba2-d1fd084f25f0/activity/builds/5c420c44-b2f6-421e-bce1-d91a283787e4
2020-04-04T19:16:40.808626+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/about/" host=takuonline.herokuapp.com request_id=ae9c0c3b-f507-403f-b127-83b8f74cd87b fwd="197.229.0.248" dyno= connect= service= status=503 bytes= protocol=http
l realised that my initial req.txt didnt have all the modules l need so l try to push a different one but l got this error
remote: Running setup.py install for pyodbc: started
remote: Running setup.py install for pyodbc: finished with status 'error'
remote: ERROR: Command errored out with exit status 1:
remote: command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bn8zgjtt/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bn8zgjtt/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ns1t96ec/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.6m/pyodbc
remote: cwd: /tmp/pip-install-bn8zgjtt/pyodbc/
remote: Complete output (16 lines):
remote: /app/.heroku/python/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
remote: warnings.warn(msg)
remote: running install
remote: running build
remote: running build_ext
remote: building 'pyodbc' extension
remote: creating build
remote: creating build/temp.linux-x86_64-3.6
remote: creating build/temp.linux-x86_64-3.6/src
remote: gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION=4.0.30 -I/app/.heroku/python/include/python3.6m -c src/buffer.cpp -o build/temp.linux-x86_64-3.6/src/buffer.o -Wno-write-strings
remote: In file included from src/buffer.cpp:12:0:
remote: src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
remote: #include <sql.h>
remote: ^~~~~~~
remote: compilation terminated.
remote: error: command 'gcc' failed with exit status 1
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-bn8zgjtt/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-bn8zgjtt/pyodbc/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ns1t96ec/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.6m/pyodbc Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to takuonline.
remote:
To https://git.heroku.com/takuonline.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/takuonline.git'