Python web No socket could be created

Source: Internet
Author: User

You need to install the Python web, you need to install the PIP, and the installation method resolves itself.
To install the Python Web:

sudo pip install web.py

The problem with the NO socket could be created was encountered while learning the Python Web:
The code to write is as follows:

#!/usr/bin/env python2
#-*-coding:utf-8-*-

Import web
urls = (
    '/', ' Index '
)
class index:< C6/>def Get (self): return
        "Hello, world!"
if __name__ = = "__main__":
   web.application (URLs, Globals ()). Run ()

After careful examination of no code errors, the runtime encountered the following error:

http://0.0.0.0:8080/
Traceback (most recent):
  File "game.py", line, in <module>
    App.run ( The
  File "/library/python/2.7/site-packages/web/application.py", line 313, and in the Run return
    Wsgi.runwsgi ( Self.wsgifunc (*middleware))
  File "/library/python/2.7/site-packages/web/wsgi.py", line, in Runwsgi
    Return Httpserver.runsimple (func, server_addr)
  File "/library/python/2.7/site-packages/web/httpserver.py", Line 157, in Runsimple
    Server.start ()
  File "/library/python/2.7/site-packages/web/wsgiserver/__init__.py", Line 1753, in start
    raise Socket.error (msg)
Socket.error:No socket could is created

Depressed ah, tangled up for a long time, thinking that the code to write a problem, the last feeling when the port out of the problem, may be occupied by the port, changed a port on the good, Haha,

Python game.py 8081 #指定在8081端口运行
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.