Hi there,
This is a beginner level problem.
I am trying to run a tutorial code from the linux terminal.
When I create a bokeh.py file with the content of code below and run it from the terminal with command “python bokeh.py”
I get the following error message, however when I type it into shell line by line it seems to work fine.
:~/Documents/coding$ python bokeh.py
Traceback (most recent call last):
File “bokeh.py”, line 1, in
from bokeh.plotting import figure, output_file, show
File “/home/firat/Documents/coding/bokeh.py”, line 1, in
from bokeh.plotting import figure, output_file, show
ImportError: No module named ‘bokeh.plotting’; ‘bokeh’ is not a package
And when I try to paste whole code into shell i get the following error
“SyntaxError: multiple statements found while compiling a single statement”
Any help would be much appreciated thanks.
code:
from bokeh.plotting import figure, output_file, show
prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
output to static HTML file
output_file(“lines.html”)
create a new plot with a title and axis labels
p = figure(title=“simple line example”, x_axis_label=‘x’, y_axis_label=‘y’)
add a line renderer with legend and line thickness
p.line(x, y, legend=“Temp.”, line_width=2)
show the results
show(p)