web.py端口被占用的错误

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了web.py端口被占用的错误相关的知识,希望对你有一定的参考价值。

运行文件Python code.py

文件里用到import web出现

Traceback (most recent call last):
File "code.py", line 14, in <module>
app.run()
File "/usr/local/lib/python2.7/dist-packages/web/application.py", line 313, in run
return wsgi.runwsgi(self.wsgifunc(*middleware))
File "/usr/local/lib/python2.7/dist-packages/web/wsgi.py", line 54, in runwsgi
return httpserver.runsimple(func, validip(listget(sys.argv, 1, ‘‘)))
File "/usr/local/lib/python2.7/dist-packages/web/httpserver.py", line 157, in runsimple
server.start()
File "/usr/local/lib/python2.7/dist-packages/web/wsgiserver/__init__.py", line 1753, in start
raise socket.error(msg)
socket.error: No socket could be created

这种情况是端口被占用,换个端口即可

python code.py 8181 #指定到8181端口执行












以上是关于web.py端口被占用的错误的主要内容,如果未能解决你的问题,请参考以下文章

解决端口被占用的方法(查看端口和关闭端口)

在eclipse中启动Tomcat报端口被占用的错误

端口被占用

UdpClient端口被重复占用错误

tomcat端口被占用解决办法

部署错误:Tomcat启动失败,服务器8080端口已被占用