Skip to content Skip to sidebar Skip to footer

Azure + Gunicorn + Flask + Azure Web App Linux: ModuleNotFoundError: No Module Named 'flaskr'

the use case I have followed the flask tutorial on those pages: https://flask.palletsprojects.com/en/1.1.x/tutorial/ The project directory is the following : /src ├── flaskr/

Solution 1:

I had a similar error without Azure. Analyzing this issue, I suspected it was an importing issue related to Gunicorn. My solution was to append the missing directory path to the beginning of my entry application script (flaskr/init.py in your case):

import sys
sys.path.append('/src/flaskr')

I don't know if it's a good practice, but it worked for me. Hope it helps for you too.


Post a Comment for "Azure + Gunicorn + Flask + Azure Web App Linux: ModuleNotFoundError: No Module Named 'flaskr'"