(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. php web开发——文件的上传和下载

    PHP用超级全局变量数组$_FILES来记录文件上传相关信息的. 1.file_uploads=on/off 是否允许通过http方式上传文件 2.max_execution_time=30 允许脚本 ...

  2. WinDbg常用命令系列---!handle

    !handle 简介 !handle扩展显示有关目标系统中一个或所有进程拥有的一个或多个句柄的信息. 使用形式 用户模式!handle [Handle [UMFlags [TypeName]]] !h ...

  3. shell脚本编程基础之while、for、until循环

    while及until循环结构 while CONDITION:do statement done 进入循环:条件满足 退出循环:条件不满足 当需要命令的执行状态返回值时,可以直接把整个命令当做循环的 ...

  4. D3.js的v5版本入门教程(第十三章)—— 饼状图

    D3.js的v5版本入门教程(第十三章) 这一章我们来绘制一个简单的饼状图,我们只绘制构成饼状图基本的元素——扇形.文字,从这一章开始,内容可能有点难理解,因为每一章都会引入比较多的难理解知识点,在这 ...

  5. fluent计算输出时均值

    / ****************************************************************************** * Created on : 2017 ...

  6. session与cookie之间的关系

    一.客户端与服务端请求响应的关系 USER(客户端) 请求 tomcat(服务器), 属于HTTP请求.http请求是无状态的,即每次服务端接收到客户端的请求时,都是一个全新的请求,服务器并不知道客户 ...

  7. Spring Cloud Eureka源码分析 --- client 注册流程

    Eureka Client 是一个Java 客户端,用于简化与Eureka Server的交互,客户端同时也具备一个内置的.使用轮询负载算法的负载均衡器. 在应用启动后,将会向Eureka Serve ...

  8. Unity3d客户端与Photon服务器数据通信

    今天先介绍一下Photon服务器是什么,可以做什么,为什么要使用它? Photon:开发多人联网游戏最轻松的方案!可以迅速简单实现多人实时在线网络游戏(pvp). Photon:透过位于各地的Phot ...

  9. Bi-Directional ConvLSTM U-Net with Densley Connected Convolutions

    Bi-Directional ConvLSTM U-Net with Densley Connected Convolutions  ICCV workshop 2019  2019-09-15 11 ...

  10. PyCharm虚拟环(Project Interpreter)手动安装第三方包图解教程

    PyCharm虚拟环(Project Interpreter)手动安装第三方包图解教程 an鑫_wolfxin2010 关注 2018.03.13 21:58* 字数 313 阅读 3782评论 1喜 ...