mnemocron / TelegramChatStats

Generate some statistics and plots from your exported Telegram chat data (using Bokeh plots with python 3)
MIT License
56 stars 12 forks source link

KeyError: 'legend' #9

Open YahyaShubbak opened 2 years ago

YahyaShubbak commented 2 years ago

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 commented 1 year ago

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

yvorlovskiy commented 1 year ago

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

Katzenbiber commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

i have 2.4.3 version yet i still see the error