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

KeyError: 'legend' #9

Open
YahyaShubbak opened this issue Nov 20, 2022 · 6 comments
Open

KeyError: 'legend' #9

YahyaShubbak opened this issue Nov 20, 2022 · 6 comments

Comments

@YahyaShubbak
Copy link

Hi,

I get the following error:

Traceback (most recent call last):
  File "C:\Users\yshub\Documents\GitHub\TelegramChatStats\telegram-statistics.py", line 267, in <module>
    main()
  File "C:\Users\yshub\Documents\GitHub\TelegramChatStats\telegram-statistics.py", line 211, in main
    raw = calculate_graphs(chat_data, date_filter, wordlist)
  File "C:\Users\yshub\Documents\GitHub\TelegramChatStats\telegram-statistics.py", line 149, in calculate_graphs
    return _message_graphs(chat_data, date_filter, wordlist)
  File "C:\Users\yshub\Documents\GitHub\TelegramChatStats\_message_graphs.py", line 278, in _message_graphs
    histogram_month(
  File "C:\Users\yshub\Documents\GitHub\TelegramChatStats\_message_graphs.py", line 435, in histogram_month
    fig.vbar(
  File "C:\Users\yshub\miniconda3\lib\site-packages\bokeh\plotting\_decorators.py", line 87, in wrapped
    return create_renderer(glyphclass, self.plot, **kwargs)
  File "C:\Users\yshub\miniconda3\lib\site-packages\bokeh\plotting\_renderer.py", line 133, in create_renderer
    update_legend(plot, legend_kwarg, glyph_renderer)
  File "C:\Users\yshub\miniconda3\lib\site-packages\bokeh\plotting\_legends.py", line 57, in update_legend
    _LEGEND_KWARG_HANDLERS[kwarg](value, legend, glyph_renderer)
KeyError: 'legend'

If I'm not mistaken, it might have to do with the current Bokeh version?
Any help is highly appreciated! And thanks in advance :)

@Katzenbiber
Copy link
Contributor

This is an issue with the bokeh version. Use bokeh==2.4.3 to fix it.

@yvorlovskiy
Copy link

Getting the same error with the updated bokeh version, any ideas on how to fix this? Thank you!

@Katzenbiber
Copy link
Contributor

If it really is the exact same error, then double check if you have the right version of bokeh installed with pip show bokeh. It should say Version: 2.4.3.

If that's installed, do you maybe use venv or conda?

@psython123
Copy link

psython123 commented Feb 4, 2023

I'm having the exact same issue. The version of bokeh is 3.0.3, though. Do I have to downgrade?

Edit: I have downgraded to version 2.4.3. Now it works for me, although it shows errors aswell.

@YahyaShubbak
Copy link
Author

For me it didn't work until I installed via conda forge. I can't tell you why though.

conda install -c conda-forge bokeh==2.4.3

@NYandisa
Copy link

i have 2.4.3 version yet i still see the error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants