bokeh error

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§

Hi,

Seems like you have an issue with your installation. Can successfully you execute just:

  import bokeh

in the python shell?

Thanks,

Bryan

···

On Jan 10, 2017, at 8:31 AM, [email protected] wrote:

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 <module>
    from bokeh.plotting import figure, output_file, show
  File "/home/firat/Documents/coding/bokeh.py", line 1, in <module>
    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)

--
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/1cd69ee9-a379-4d72-b653-da583915f2e6%40continuum.io.
For more options, visit https://groups.google.com/a/continuum.io/d/optout.