ImportError: No module named... in __init__.py file ImportError: No module named... in __init__.py file flask flask

ImportError: No module named... in __init__.py file


As it has been stated in the above comments you have a circular dependency. To avoid it, you should make your current couponmonk_project as module, that will be run by another python script. According to the Flask documentation your project should look like:

/home/giri/couponmonk_project    __init__.py    /home/giri/couponmonk_project/couponmonk_project    __init__.py    views.py

where inner folder couponmonk_project is your present project, and outer folder couponmonk_project is the new one. Thus, file /home/giri/couponmonk_project/__init__.py should be something like:

from couponmonk_project import appimport couponmonk_project.viewsapp.run()

and your file /home/giri/couponmonk_project/coupon_monk/project__init__.py is:

from flask import Flaskapp = Flask(__name__)app.debug = True