(flask_venv) D:\DjangoProject\flask_test>flask db init
Traceback (most recent call last):
File "c:\users\daiyongdong0520\appdata\local\programs\python\python37\Lib\runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "c:\users\daiyongdong0520\appdata\local\programs\python\python37\Lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "d:\virtualenv\flask_venv\Scripts\flask.exe\__main__.py", line 7, in <module>
File "d:\virtualenv\flask_venv\lib\site-packages\flask\cli.py", line 966, in main
cli.main(prog_name="python -m flask" if as_module else None)
File "d:\virtualenv\flask_venv\lib\site-packages\flask\cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "d:\virtualenv\flask_venv\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "d:\virtualenv\flask_venv\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "d:\virtualenv\flask_venv\lib\site-packages\click\core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "d:\virtualenv\flask_venv\lib\site-packages\click\core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "d:\virtualenv\flask_venv\lib\site-packages\click\core.py", line 555, in invoke
return callback(*args, **kwargs)
File "d:\virtualenv\flask_venv\lib\site-packages\click\decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "d:\virtualenv\flask_venv\lib\site-packages\flask\cli.py", line 425, in decorator
with __ctx.ensure_object(ScriptInfo).load_app().app_context():
File "d:\virtualenv\flask_venv\lib\site-packages\flask\cli.py", line 392, in load_app
app = locate_app(self, import_name, None, raise_if_not_found=False)
File "d:\virtualenv\flask_venv\lib\site-packages\flask\cli.py", line 257, in locate_app
return find_best_app(script_info, module)
File "d:\virtualenv\flask_venv\lib\site-packages\flask\cli.py", line 83, in find_best_app
app = call_factory(script_info, app_factory)
File "d:\virtualenv\flask_venv\lib\site-packages\flask\cli.py", line 117, in call_factory
return app_factory(script_info)
File "D:\DjangoProject\flask_test\app\__init__.py", line 23, in create_app
app.config.from_object(config[config_name])
KeyError: <flask.cli.ScriptInfo object at 0x000001638AC164E0>

报错原因:

没有指向指向启动文件 flask_test.py

添加一个环境变量,解决

set FLASK_APP=flask_test.py

flask报错 KeyError: <flask.cli.ScriptInfo object at 0x000001638AC164E0>的更多相关文章

  1. webpack 打包报错:One CLI for webpack must be installed. These are recommended choices, delivered as separate packages

    webpack 打包报错: One CLI for webpack must be installed. These are recommended choices, delivered as sep ...

  2. 【Python】Centos + gunicorn+flask 报错ImportError: No module named request

    今天用Python去下载图片,用到了 urllib.request,这个是python3的方法.python2 使用的是urllib2 遇到了这么个问题后台报错,ImportError: No mod ...

  3. 运行python脚本时,报错InsecurePlatformWarning: A true SSLContext object is not available,解决方法

    今天,要在新环境里运行一个python脚本,遇到下面的报错: /usr/lib/python2.7/site-packages/urllib3/util/ssl_.py:160: InsecurePl ...

  4. 报错:java.lang.IllegalArgumentException: object is not an instance of declaring class

    反射的报错信息如下: java.lang.IllegalArgumentException: object is not an instance of declaring class at sun.r ...

  5. 发送邮件报错javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multipart/mixed

    关于使用javaMail发送邮件报错:javax.activation.UnsupportedDataTypeException: no object DCH for MIME type multip ...

  6. ReactNative报错null is not an object (evaluating '_rngesturehandlermodule.default.direction')

    程序报错: null is not an object (evaluating 'rngesturehandlermodule.default.direction') 解决: react-native ...

  7. keras报错:AttributeError: '_thread._local' object has no attribute 'value'

    需求是使用pyqt5中的槽函数运行keras模型训练,为了不让工具在模型训练的过程中出现假死的现象,于是把训练操作放到单独的线程中运行,于是问题来了,训练操作在主线程运行时正常,但是界面假死,假若训练 ...

  8. bootstrap导航条报错 Uncaught TypeError: Cannot convert object to primitive value

    原文: https://feiffy.cc/uncaught-typeerror-cannot-convert-object-to-primitive-value 最近发现我的博客页面移动端上下拉菜单 ...

  9. flask报错No module named 'flask.ext'

    解决: from flask.ext.httpauth import HTTPBasicAuth 改为 from flask_httpauth import HTTPBasicAuth 提示Modul ...

随机推荐

  1. tensorflow2.0 学习(三)

    用tensorflow2.0 版回顾了一下mnist的学习 代码如下,感觉这个版本下的mnist学习更简洁,更方便 关于tensorflow的基础知识,这里就不更新了,用到什么就到网上取搜索相关的知识 ...

  2. 详解如何在CentOS7中使用Nginx和PHP7-FPM安装Nextcloud

    转载地址:https://www.jb51.net/article/109382.htm 这篇文章主要介绍了详解如何在CentOS7中使用Nginx和PHP7-FPM安装Nextcloud,会通过 N ...

  3. 数据库 Hash Join的定义,原理,算法,成本,模式和位图

    Hash Join只能用于相等连接,且只能在CBO优化器模式下.相对于nested loop join,hash join更适合处理大型结果集       Hash Join的执行计划第1个是hash ...

  4. git create remote branch (五)

    admin@PC-panzidong MINGW64 ~/WebstormProjects/backEndServer (master) 查看本地分支信息$ git branch* master ad ...

  5. luoguP3003 [USACO10DEC]苹果交货Apple Delivery

    LOL新英雄卡莎点击就送 一句话题意: 三个点a1,a2,b,求从b到a1和a2的最短路 做法:求出a1->b和a2->b的最短路,两者取min,之后再加上a1->a2的最短路 为啥 ...

  6. 洛谷 P2939 [USACO09FEB]改造路Revamping Trails 题解

    P2939 [USACO09FEB]改造路Revamping Trails 题目描述 Farmer John dutifully checks on the cows every day. He tr ...

  7. 特征的非线性变换(Feature Non-linear Transformation)

    有时候特征x和目标y不呈线性关系,线性模型y=wx+b不能很好地反映事物的规律或者无法对事物进行有效分类,因此此时我们需要使用非线性模型. (x=([x1,x2,...,xn])T,w=([w1,w2 ...

  8. ThinkPad T410i 2516A21 升級手札(換SSD固態硬碟、I7 CPU、開機20秒)

    最近筆記本越來越慢,開機得20分鐘,而且CPU動不動就飆到80度,趁著開學網上活動,準備給老伙計來一次重大升級.查一下主板芯片,最高支持8G內存,已經滿了,光驅位加了一個1T機械硬盤,那麼能升級的就只 ...

  9. C博客作业02——循环结构

    0.展示PTA总分 单循环题目集 嵌套循环题目集 1.本章学习总结 1.1学习内容总结 (a)while语句 while(表达式) { 循环体语句: } 执行流程:当表达式的值为"真&quo ...

  10. GoCN每日新闻(2019-10-09)

    GoCN每日新闻(2019-10-09) GoCN每日新闻(2019-10-09) 1. 我们如何将服务延迟减少了98% https://blog.gojekengineering.com/the-n ...