OsError [WinError 10048] when using server_document

Hi,

The web app is running, but I get this error in the terminal. What can I do to fix it? (see snippet of code below.

WinError.PNG

Index page

@app.route(’/’, methods = [‘GET’])

def bkapp_page():

# Determine the selected feature

current_feature_name = request.args.get(“feature_name”)

if current_feature_name == None:

current_feature_name = “Test1”

# Create the plot

plot1 = makeTracerFigure(current_feature_name)

plot = row(plot1, width = 800)

# Embed plot into HTML via Flask Render

script, div = components(plot)

animationPlotter = server_document(‘http://localhost:5006/animationPlotter’)

return render_template(“homepage.html”,

script = script, div = div,

animationPlotter = animationPlotter,

featurenames = featurenames, current_feature_name = current_feature_name)

def bk_worker():

server = Server({’/animationPlotter’: animationPlotter}, io_loop = IOLoop(), allow_websocket_origin = [“localhost:8000”])

server.start()

server.io_loop.start()

from threading import Thread

Thread(target = bk_worker).start()

if name == ‘main’:

print(‘Opening single process Flask app with embedded Bokeh application on http://localhost:8000/’)

app.debug = True

app.run(port = 8000)

``

This error message is coming from the OS, it is saying that the host/port combination is already in use by another program on the system. The most typical reason for that is that you have another Bokeh server process left around running taking up the same host/port that you did not quit/terminate.

Thanks,

Bryan

···

On Sep 12, 2018, at 01:57, Zana <[email protected]> wrote:

Hi,

The web app is running, but I get this error in the terminal. What can I do to fix it? (see snippet of code below.

<WinError.PNG>

# Index page
@app.route('/', methods = ['GET'])
def bkapp_page():
  # Determine the selected feature
    current_feature_name = request.args.get("feature_name")
    
    if current_feature_name == None:
        current_feature_name = "Test1"
        
  # Create the plot
    plot1 = makeTracerFigure(current_feature_name)
    
    plot = row(plot1, width = 800)

  # Embed plot into HTML via Flask Render
    script, div = components(plot)
    animationPlotter = server_document('http://localhost:5006/animationPlotter')

    return render_template("homepage.html",
                           script = script, div = div,
                           animationPlotter = animationPlotter,
                           featurenames = featurenames, current_feature_name = current_feature_name)

def bk_worker():
    server = Server({'/animationPlotter': animationPlotter}, io_loop = IOLoop(), allow_websocket_origin = ["localhost:8000"])

    server.start()
    server.io_loop.start()

from threading import Thread
Thread(target = bk_worker).start()

if __name__ == '__main__':
    print('Opening single process Flask app with embedded Bokeh application on http://localhost:8000/')
    
    app.debug = True
    app.run(port = 8000)

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/3ce023a8-9d5c-4400-8bae-46342078f97b%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.
<WinError.PNG>