问答详情
源自:2-1 web开发基础

为什么在输入python hello.py之后出现了socket error

http://0.0.0.0:8080/

Traceback (most recent call last):

  File "hello.py", line 15, in <module>

    app.run()

  File "C:\Python27\lib\site-packages\web\application.py", line 313, in run

    return wsgi.runwsgi(self.wsgifunc(*middleware))

  File "C:\Python27\lib\site-packages\web\wsgi.py", line 59, in runwsgi

    return httpserver.runsimple(func, server_addr)

  File "C:\Python27\lib\site-packages\web\httpserver.py", line 157, in runsimple

    server.start()

  File "C:\Python27\lib\site-packages\web\wsgiserver\__init__.py", line 1753, in start

    raise socket.error(msg)

socket.error: No socket could be created


提问者:lmm2000 2018-04-01 10:18

个回答

  • 慕设计7193474
    2018-07-24 14:37:55

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

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

  • FP1995XY
    2018-06-22 15:46:24

    可能是端口被占用

  • qq_丿乱世丶无情_0
    2018-04-07 23:05:41

    尝试关闭防火墙