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

时间:2013-07-22 05:07:28

标签: python python-2.7

当我设置application.py时,它显示socket.error:[Errno 98]地址已在使用中。

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

1 个答案:

答案 0 :(得分:95)

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

$ lsof -i :8000

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