Khaled Saleh
Khaled Saleh

Reputation: 79

Bokeh server is not recognized

Trying to run simple app from Kevin Jolly's Hands-On Data Visualization with Bokeh Packt.

#Import the required packages 
from bokeh.layouts import widgetbox 
from bokeh.models import Slider 
from bokeh.io import curdoc 
#Create a slider widget 
slider_widget = Slider( start = 0, end = 100, step = 10, title = 'Single Slider') 
#Create a layout for the widget 
slider_layout = widgetbox( slider_widget) 
#Add the slider widget to the application 
curdoc(). add_root( slider_layout)

Then tried to start bokeh server:

...\Python_Scripts\Sublime> bokeh serve --show bokeh.py bokeh : The term 'bokeh' is not recognized as the name of a cmdlet, function, script file, or operable program.

bokeh info

Python version : 3.7.3 (default, Apr 24 2019, 15:29:51) [MSC v.1915 64 bit (AMD64)]

IPython version : 7.8.0

Tornado version : 6.0.3

Bokeh version : 1.3.4

BokehJS static path : C:\Users\k S\Anaconda3\lib\site-packages\bokeh\server\static

node.js version : (not installed)

npm version : (not installed)

Previous post with same problem did not provide working solution, please help.

Upvotes: 0

Views: 3886

Answers (1)

bigreddot
bigreddot

Reputation: 34568

First I would strongly suggest renaming your file to something other than bokeh.py. Due to the way Python itself works, this can sometimes result in Python trying to load the wrong module.

It's exceedingly strange that bokeh info could work but bokeh serve would not, since they are subcommands of literally the same program file. If renaming the script does not help, then you can always invoke the server using the Python -m command line option:

python -m bokeh serve --show app.py

If this does not work it can mean one thing only: the python executable you are running is a different Python environment than the one that you installed Bokeh into.

Upvotes: 2

Related Questions