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端口执行