ModuleNotFoundError: No module named 'bokeh.tile_providers'

Hello.
I’m trying to run the following lines of code in Spyder 6.0.4:

import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import pandas_bokeh
pandas_bokeh.output_notebook()

But I get this error:

ModuleNotFoundError Traceback (most recent call last)

ModuleNotFoundError: No module named ‘bokeh.tile_providers’

Searching for answers, I found this link:
https://github.com/holoviz/datashader/issues/72

From what I understand, reinstalling it solved it. I did that, but it’s still the same.

The bokeh.tile_providers module was deprecated a long time ago, and fully removed in version 3.5 last year. If pandas_bokeh (which is a separate project, maintained by different people, unaffiliated with Bokeh) has not updated to account for this change, then your only option to keep using pandas_bokeh is to only install Bokeh versions 3.4.x or earlier.

FWIW it looks like pandas_bokeh is no longer actively maintained. You might want to consider either using Bokeh APIs directly, or other tools built on top of Bokeh that are still maintained (e.g. HoloViews, GeoViews, Panel, etc).

Edit: also please always make sure to use proper code formatting blocks (either with the </> icon on the editing toolbar, or triple backtick ``` fences around the code blocks)

Thanks, Bryan.
I’ll try to find Bokeh 3.4 because my current version is 3.7.2.

About the correct code format, I realized it late, and while I was fixing it, I saw your reply.

1 Like