使用烧瓶运行 Hello world 脚本:
# coding=utf-8
from flask import Flask
app = Flask(__name__)
@app.route("/")
def hello():
return "Hello World!"
我收到以下错误:
C:\anaconda3\python.exe C:/anaconda3/Scripts/flask-script.py run
Traceback (most recent call last):
File "C:/anaconda3/Scripts/flask-script.py", line 9, in <module>
sys.exit(main())
File "C:\anaconda3\lib\site-packages\flask\cli.py", line 966, in main
cli.main(prog_name="python -m flask" if as_module else None)
File "C:\anaconda3\lib\site-packages\flask\cli.py", line 586, in main
return super(FlaskGroup, self).main(*args, **kwargs)
File "C:\anaconda3\lib\site-packages\click\core.py", line 717, in main
rv = self.invoke(ctx)
File "C:\anaconda3\lib\site-packages\click\core.py", line 1135, in invoke
sub_ctx = cmd.make_context(cmd_name, args, parent=ctx)
File "C:\anaconda3\lib\site-packages\click\core.py", line 641, in make_context
self.parse_args(ctx, args)
File "C:\anaconda3\lib\site-packages\click\core.py", line 940, in parse_args
value, args = param.handle_parse_result(ctx, opts, args)
File "C:\anaconda3\lib\site-packages\click\core.py", line 1477, in handle_parse_result
self.callback, ctx, self, value)
File "C:\anaconda3\lib\site-packages\click\core.py", line 96, in invoke_param_callback
return callback(ctx, param, value)
File "C:\anaconda3\lib\site-packages\flask\cli.py", line 742, in _validate_key
is_context = isinstance(cert, ssl.SSLContext)
AttributeError: 'NoneType' object has no attribute 'SSLContext'
Process finished with exit code 1
Flask 1.1.1 已经安装在 anaconda3 环境中。我在 Win10 Home 上使用 PyCharm 2018.3.7。
你能帮我解决这个问题吗?或者错误说明了什么?先感谢您!