I created a website using flask back-end, every thing works fine locally, but when i tried to deploy it on heroku I got those errors >> this is my Procfile
web: gunicorn wsgi:app
this is my wsgi file
from . import create_app
app = create_app()
this is my create app code >>
def create_app():
app = Flask(__name__)
if not os.getenv("DATABASE_URL"):
raise RuntimeError("DATABASE_URL is not set")
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv("DATABASE_URL")
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db = SQLAlchemy()
db.init_app(app)
app.config['SECRET_KEY'] = os.getenv("SECRET_KEY")
login_manager = LoginManager()
login_manager.init_app(app)
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
return app
and this what I get from heroku logs
2020-03-25T07:37:09.102934+00:00 heroku[web.1]: State changed from starting to crashed
2020-03-25T07:37:08.996125+00:00 app[web.1]: Traceback (most recent call last):
2020-03-25T07:37:08.996155+00:00 app[web.1]: File "/app/.heroku/python/bin/gunicorn", line 7, in <module>
2020-03-25T07:37:08.996318+00:00 app[web.1]: from gunicorn.app.wsgiapp import run
2020-03-25T07:37:08.996337+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 9, in <module>
2020-03-25T07:37:08.996465+00:00 app[web.1]: from gunicorn.app.base import Application
2020-03-25T07:37:08.996496+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/app/base.py", line 11, in <module>
2020-03-25T07:37:08.996623+00:00 app[web.1]: from gunicorn import util
2020-03-25T07:37:08.996654+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/gunicorn/util.py", line 6, in <module>
2020-03-25T07:37:08.996775+00:00 app[web.1]: import ctypes.util
2020-03-25T07:37:08.996798+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/ctypes/util.py", line 3, in <module>
2020-03-25T07:37:08.996912+00:00 app[web.1]: import subprocess
2020-03-25T07:37:08.996934+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/subprocess.py", line 153, in <module>
2020-03-25T07:37:08.997239+00:00 app[web.1]: import select
2020-03-25T07:37:08.997265+00:00 app[web.1]: File "/app/select.py", line 3, in <module>
2020-03-25T07:37:08.997509+00:00 app[web.1]: from flask import Flask,jsonify
2020-03-25T07:37:08.997541+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/flask/__init__.py", line 16, in <module>
2020-03-25T07:37:08.997670+00:00 app[web.1]: from werkzeug.exceptions import abort
2020-03-25T07:37:08.997694+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/werkzeug/__init__.py", line 218, in <module>
2020-03-25T07:37:08.997974+00:00 app[web.1]: from .serving import run_simple
2020-03-25T07:37:08.997999+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/site-packages/werkzeug/serving.py", line 41, in <module>
2020-03-25T07:37:08.998139+00:00 app[web.1]: import socket
2020-03-25T07:37:08.998163+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/socket.py", line 52, in <module>
2020-03-25T07:37:08.998310+00:00 app[web.1]: import os, sys, io, selectors
2020-03-25T07:37:08.998334+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/selectors.py", line 290, in <module>
2020-03-25T07:37:08.998523+00:00 app[web.1]: class SelectSelector(_BaseSelectorImpl):
2020-03-25T07:37:08.998547+00:00 app[web.1]: File "/app/.heroku/python/lib/python3.7/selectors.py", line 317, in SelectSelector
2020-03-25T07:37:08.998734+00:00 app[web.1]: _select = select.select
2020-03-25T07:37:08.998772+00:00 app[web.1]: AttributeError: module 'select' has no attribute 'select'
2020-03-25T07:37:09.084647+00:00 heroku[web.1]: Process exited with status 1
2020-03-25T07:39:11.077962+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=bookreviews101.herokuapp.com request_id=a08f3517-e1e7-439a-bd77-f676d217cc8b fwd="197.165.201.207" dyno= connect= service= status=503 bytes= protocol=https
2020-03-25T07:39:11.531655+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=bookreviews101.herokuapp.com request_id=27ee6d2f-2e85-4cb3-87dd-9856f84285e6 fwd="197.165.201.207" dyno= connect= service= status=503 bytes= protocol=https
I want to know what is the cause of this error and how to fix it