from flask import Flask
app=Flask(__name__)
@app.route("/",methods=["GET"])
def index():
return "hello,world",200
if __name__=="__main__":
app.run(host="0.0.0.0",port=5004)
Traceback (most recent call last):
File "b.py", line 10, in <module>
app.run(host="0.0.0.0",port=5004)
File "/Users/jiangyd/PycharmProjects/untitled16/venv/lib/python3.7/site-packages/flask/app.py", line 922, in run
run_simple(t.cast(str, host), port, self, **options)
File "/Users/jiangyd/PycharmProjects/untitled16/venv/lib/python3.7/site-packages/werkzeug/serving.py", line 1008, in run_simple
inner()
File "/Users/jiangyd/PycharmProjects/untitled16/venv/lib/python3.7/site-packages/werkzeug/serving.py", line 957, in inner
fd=fd,
File "/Users/jiangyd/PycharmProjects/untitled16/venv/lib/python3.7/site-packages/werkzeug/serving.py", line 781, in make_server
host, port, app, request_handler, passthrough_errors, ssl_context, fd=fd
File "/Users/jiangyd/PycharmProjects/untitled16/venv/lib/python3.7/site-packages/werkzeug/serving.py", line 686, in __init__
super().__init__(server_address, handler) # type: ignore
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 452, in __init__
self.server_bind()
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/server.py", line 137, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 466, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 48] Address already in use
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。