Debugging a flask app fails

Hey folks,

I am currently trying to get my flask app to debug. It runs through in normal mode however in debug mode (PyCharm, not the flask one) I keep getting the error "No module named flask.flask". So this is my configuration:

I noticed if I uncheck FLASK_DEBUG the error does not show up. Both Windows and macOS same issue.

Specs:

Win10, PyCharm 2019.1.3, Python 3.6, Flask 1.1.0

macOS 10.14, PyCharm 2019.1.3, Python 3.7, Flask 1.1.1

I am thankful for any advice.

EDIT: I just tried to break down, whether it could be something wrong with my project so I ran this minimal example and I am ending up with the same error.

from flask import Flask

app = Flask(__name__)


@app.route('/')
def hello_world():
return 'Hello World!'


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

So at least for me it is a reproducible behavior. 

8 comments
Comment actions Permalink

This is happening to me as well just yesterday. And debugger used to work 100% sure with FLASK_DEBUG = True

1
Comment actions Permalink

Flask in pip updated from 1.0.3 to 1.1.1 yesterday, introducing this error message to my project.

I've simply frozen my requirements.txt to 1.0.3 until the situation improves.

Flask==1.0.*


Edit: on closer inspection it seems to have been updating more lately (https://pypi.org/project/Flask/#history), so I don't know which particular version bump was the culprit. 1.0.3 works for me still.

0
Comment actions Permalink

@Jarkko That's what I was gonna check next, since I created a new venv by coincidence yesterday as well. Thanks

0
Comment actions Permalink

@Jarkko I also updated recently. As you and Gustavo figured, it used to work for me prior to the update, maybe I should have covered this aspect in my initial post... I chose to postpone the flask update, too.

0
Comment actions Permalink

untick the 'FLASK_DEBUG' solves the issue for me

0
Comment actions Permalink

@Ken Liqi This just disables the FLASK_DEBUG mode but does not solve the problem.

0
Comment actions Permalink

Guys, I checked the whole internet itself but could not find the answer, but on that link Andrey Resler posted I have found that i should update my Werkzeug to 0.15.5, but I already had that, so I have tried to downgrade it to 0.15.4 and suddently it works! 

0

Please sign in to leave a comment.