1

I have followed this tutorial. It was working fine with until, in my __init__.py file, I import my recognizer file


from flask import Flask
import sys
sys.path.append('/home/directory/')
from KNN_Recognition import trainCode //this line

app = Flask(__name__)

@app.route('/')
def homepage():
    return "Hi there, how ya doin?"


if __name__ == "__main__":
    app.run()

Now my webpage is not loading at all. Please Help. I have run the KNN_Recognition.py independently and it is working without any error.

Also instead of using libapache2-mod-wsgi, I have used libapache2-mod-wsgi-py3

Valerii Boldakov
  • 1,751
  • 9
  • 19
  • You should try running your code with the Flask development server, instead of with apache, and see if there is any error log output. Just run your flask module on the command line: `export FLASK_ENV=development; python -m flask run` Also have a read over the docs: https://flask.palletsprojects.com/en/1.1.x/quickstart/#debug-mode – Zv_oDD Mar 24 '20 at 07:41
  • Thank you. I have tried it and the flask runs without any error but the page is still not loading. – Ryan Goslin Mar 24 '20 at 11:40
  • OK, I'm guessing your imported code involves `pandas` or `numpy` (based on the name and domain of that topic). Have a look at https://github.com/pandas-dev/pandas/issues/14641 and https://stackoverflow.com/questions/41099433 – Zv_oDD Mar 24 '20 at 17:31
  • @Zv_oDD Thank a lot man. The second one solved my error. – Ryan Goslin Mar 25 '20 at 06:54

1 Answers1

1

As suggested my @Zv_oDD, from this link I had to add

WSGIApplicationGroup %{GLOBAL} 

to my Flask.conf file