famargar famargar -4 years ago 313
Python Question

ImportError: No module named 'bokeh.layouts'

I am trying to run some bokeh examples, and when I import bokeh.layouts (either from the ipython interpreter, or in a jupyter notebook) I get the following error:

ImportError: No module named 'bokeh.layouts'

I am using python 3.5 and bokeh 0.12.4 installed via conda install bokeh. What's wrong with this?

Answer Source

You have more than python or python environment installed on your system, and the python that you are actually running is different from the one that your have installed bokeh into.

As a concrete example, here is one possible scenario, similar to ones I have seen on occasion:

  • Jupyter notebook installed in the OS/system python but not the conda root env
  • Bokeh conda env but Jupyter notebook is now
  • User runs notebook, and this uses the system python, which has a different bokeh version (or none at all)
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download