python socket.error: [Errno 98] 地址已被使用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/17780291/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 09:11:27  来源:igfitidea点击:

python socket.error: [Errno 98] Address already in use

pythonpython-2.7

提问by emuu

when i setup application.py, it shows that socket.error: [Errno 98] Address already in use.

当我设置 application.py 时,它显示 socket.error: [Errno 98] Address already in use。

Traceback (most recent call last):
File "application.py", line 121, in <module>
main()
File "application.py", line 117, in main
http_server.listen(options.port)
File "/usr/local/lib/python2.7/site-packages/tornado-3.1-py2.7.egg/tornado/tcpserver.py", line 117, in listen
sockets = bind_sockets(port, address=address)
File "/usr/local/lib/python2.7/site-packages/tornado-3.1-py2.7.egg/tornado/netutil.py", line 90, in bind_sockets
sock.bind(sockaddr)
File "/usr/local/lib/python2.7/socket.py", line 224, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use

回答by the5fire

There is obviously another process listening on the port. You might find out that process by using the following command:

显然有另一个进程在监听端口。您可能会使用以下命令找到该过程:

$ lsof -i :8000

or change your tornado app's port. tornado's error info not Explicitlyon this.

或更改您的 Tornado 应用程序的端口。龙卷风的错误信息不是明确的