1

I am trying to use the library pandasgui but no matter what I do I always get the error:

module 'bokeh.plotting' has no attribute 'Figure'

Here is the code:

import pandas as pd
from pandasgui import show
df = pd.DataFrame({'a':[1,2,3], 'b':[4,5,6], 'c':[7,8,9]})
show(df)

I tried from bokeh.plotting import Figure and from bokeh.plotting import *

1
  • Your code doesn't include any import of bokeh - is there more code than you have shared above? My guess is that you are importing bokeh elsewhere and that is doing some work behind the scenes to hijack your plotting workflow but without creating the standard matplotlib figure normally created by a DataFrame. Commented Sep 6, 2023 at 15:00

1 Answer 1

5

Figure (capital F) was deprecated very long ago, and removed in Bokeh 3.0 several years ago, in order to remove an API confusion. Now there is only the figure (lower-case f) remaining. The library you are using will need to update itself accordingly, or else you will need to downgrade to Bokeh 2.x.

4
  • So this means that the whole pandasgui library is obsolete now ?
    – grimad
    Commented Sep 6, 2023 at 15:49
  • That depends on whether the library is still actively maintained. Any library that is not continuously maintained will eventually become obsolete. But I have never used pandasgui and am not familiar with its development or maintainers. This would probably be a good question for you to raise on their GitHub issue tracker. All that said, presumably it still works however it used to work, with Bokeh 2.x installed.
    – bigreddot
    Commented Sep 6, 2023 at 16:44
  • 1
    It still works if you go to the utilities.py file that the error is found in and modify the line that has the "import bokeh.plotting.Figure" to show lower case F like "import bokeh.plotting.figure". I just tried it as I ran into same error and can confirm it opens the pandas GUI frame now.
    – mitoKon
    Commented Sep 17, 2023 at 15:44
  • I'd encourage anyone who uses pandasgui to submit a PR to the project to update it.
    – bigreddot
    Commented Sep 19, 2023 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.