Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get error: module 'bokeh.plotting' has no attribute 'Figure' #230

Open
raodan218 opened this issue Jun 9, 2023 · 4 comments
Open

Get error: module 'bokeh.plotting' has no attribute 'Figure' #230

raodan218 opened this issue Jun 9, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@raodan218
Copy link

PLEASE FILL OUT THE TEMPLATE

Describe the bug

Using pandasgui in my code to show DataFrame as following:

import pandas as pd
import pandasgui

# ignore how to get df
df = pd.DataFrame(...)
pandasgui.show(df)

Get error: module 'bokeh.plotting' has no attribute 'Figure'. Did you mean: 'figure'

Environment
OS: Windows 10
Python: 3.10
IDE: VS Code

Package versions

ipython==8.10.0
ipython-genutils==0.2.0
pandasgui==0.2.14
plotly==5.10.0
PyQt5==5.15.9
PyQt5-sip==12.12.1
PyQtWebEngine==5.15.6
bokeh==3.1.1

In source file utility.py:446, following code:

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

Change 'bokeh.plotting.Figure' to 'bokeh.plotting.figure' (Figure to lower case)
Everything is OK

@raodan218 raodan218 added the bug Something isn't working label Jun 9, 2023
@jj-github-jj
Copy link

same problem here . looks like migration guide fro bokeh https://github.com/bokeh/bokeh/wiki/Migration-Guides says Figure has been removed
the code could look for either Figure or figure for compatibility with Bokeh pre 3.0 and post 3.0

Bokeh document
Removals
bokeh.server.django was moved to a separate project bokeh_django, which should be a drop-in replacement in most cases. bokeh_django was also updated to work with Django 3.x and 4.x.

Figure

The duplicative attribute Figure (capital-F) was removed from bokeh.plotting. Use bokeh.plotting.figure (lowercase-f) instead.

@Baehrl
Copy link

Baehrl commented Aug 29, 2023

Same problem and error message here. Unfortunately, I have no write access to change the utility.py file. It can still be solved with downgrading bokeh to version 2.4.3 or 2.4.2. However, my problem is that this is incompatible with dask, which needs for its dashboard verion >3.0*

@stephantamminga
Copy link
Contributor

stephantamminga commented Dec 6, 2023

I submitted this Pull Request to fix it.

Edit: the pull request was just merged.

@bryevdv
Copy link

bryevdv commented Aug 7, 2024

Just noting that there is not really a need for a version check as in the PR. Lowercase-f figure will work the same for all versions newer than 1.0 (and 0.x versions before that are too old to consider for any use in 2024)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants