Executing pandasgui package raises a AttributeError

277 Views Asked by At

I'm new on python and want to use "pandasgui" package for leaning dataframe. When trying to run a demo script located on the official page of PyPI(text),

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)

but the below exception occures and cannot move forward on my own:

Exception has occurred: AttributeError module 'bokeh.plotting' has no attribute 'Figure' File "C:\Python_Project\TestPython\TestPython.py", line 4, in <module> show(df) AttributeError: module 'bokeh.plotting' has no attribute 'Figure'

I tried uninstall --> re-install bokeh, pandas, pandasgui, but not works.

It seems like bokeh.plotting on current version doesn't have Figure any more(it used to be??), but bokeh.plotting.figure has it. pandasgui.show method thinks bokeh.plotting has but actually latest version it moved to under bokeh.plotting.figure.

Is it the reason for the error?? And how could I run it properly?

I would be really glad if someone gives me some ideas.

Environments: python 3.10.4 pandasgui 0.2.14 bokeh 3.0.3 pandas 1.5.3

1

There are 1 best solutions below

0
On

In

/pandasgui/utility.py

edit line 473 the word "Figure" upper case from:

if issubclass(type(fig), bokeh.plotting.Figure):

to the word "figure" lower case:

if issubclass(type(fig), bokeh.plotting.figure):