Flask - ImportError: No module named app

前端 未结 7 1542
故里飘歌
故里飘歌 2020-12-15 16:31

First I created __init__.py

from flask import Flask

app = Flask(__name__)

Then in a separate file, in the same directory,

7条回答
  •  春和景丽
    2020-12-15 16:58

    I solved this as follows -

    $export FLASK_APP=run
    
    $flask run
    

    After executing this command. I don't get any error, my app running smoothly.

提交回复
热议问题