执行flask应用程序时出现错误“ io.UnsupportedOperation:fileno”

时间:2019-05-29 14:31:47

标签: python python-3.x flask

我已经安装了flask软件包,并想运行一些基本代码

from flask import Flask
app = Flask(__name__)

@app.route("/")
def hello():
    return "Hello World!"

if __name__ == "__main__":
    app.run()

但是它显示了一些错误:

Traceback (most recent call last):
  File "C:/Users/Hi/Desktop/web_appp.py", line 9, in <module>
    app.run()
  File "C:\Users\Hi\AppData\Local\Programs\Python\Python37\lib\site-packages\flask\app.py", line 939, in run
    cli.show_server_banner(self.env, self.debug, self.name, False)
  File "C:\Users\Hi\AppData\Local\Programs\Python\Python37\lib\site-packages\flask\cli.py", line 641, in show_server_banner
    click.echo(message)
  File "C:\Users\Hi\AppData\Local\Programs\Python\Python37\lib\site-packages\click\utils.py", line 218, in echo
    file = _default_text_stdout()
  File "C:\Users\Hi\AppData\Local\Programs\Python\Python37\lib\site-packages\click\_compat.py", line 675, in func
    rv = wrapper_func()
  File "C:\Users\Hi\AppData\Local\Programs\Python\Python37\lib\site-packages\click\_compat.py", line 436, in get_text_stdout
    rv = _get_windows_console_stream(sys.stdout, encoding, errors)
  File "C:\Users\Hi\AppData\Local\Programs\Python\Python37\lib\site-packages\click\_winconsole.py", line 295, in _get_windows_console_stream
    func = _stream_factories.get(f.fileno())
io.UnsupportedOperation: fileno

0 个答案:

没有答案