如果我运行命令,一切都会正常-
if status == 0:
但是当我跑步时-
>>> python3 app.py
我遇到了错误
>>> flask run
并且我将环境变量设置为-
Error: While importing "application.app" ....
ModuleNotFoundError: No module named 'lib'
我的文件如下所示-
app.py
>>> export FLASK APP=app.py
my_api.py
import lib.logger as logger
import api.my_api as my_api
def run():
logger.init_logging()
my_api.app.run()
if __name__ == '__main__':
run()
文件夹结构
from flask import Flask
from flask import request
app = Flask(__name__)
@app.route('/')
def test():
return 'success'