ebellocchia / telegram_crypto_price_bot

Telegram bot for displaying cryptocurrencies prices and charts
MIT License
53 stars 21 forks source link

Error on PRICE_GET_SINGLE_CMD #3

Closed fouille closed 2 years ago

fouille commented 2 years ago

When I run for exemple /pricebot_get_single tamadoge usd 2 I have an error in CLI :

/Library/Python/3.9/lib/python/site-packages/telegram_crypto_price_bot/chart_info/chart_info_file_saver.py:79: UserWarning: Starting a Matplotlib GUI outside of the main thread will likely fail.
  fig, ax = plt.subplots()
2022-10-06 18:28:00.061 Python[6434:232584] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
(
        0   CoreFoundation                      0x00007ff8018f647b __exceptionPreprocess + 242
        1   libobjc.A.dylib                     0x00007ff801445e25 objc_exception_throw + 48
        2   CoreFoundation                      0x00007ff80191e616 _CFBundleGetValueForInfoKey + 0
        3   AppKit                              0x00007ff8049c1e99 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 307
        4   AppKit                              0x00007ff8049aee0f -[NSWindow _initContent:styleMask:backing:defer:contentView:] + 1247
        5   AppKit                              0x00007ff8049ae929 -[NSWindow initWithContentRect:styleMask:backing:defer:] + 42
        6   _macosx.cpython-39-darwin.so        0x000000010d061d3e -[Window initWithContentRect:styleMask:backing:defer:withManager:] + 62
        7   _macosx.cpython-39-darwin.so        0x000000010d065400 FigureManager_init + 256
        8   Python3                             0x00000001080c0b9c _PyType_Lookup + 38268
        9   Python3                             0x0000000108065f69 PyComplex_AsCComplex + 10937
        10  Python3                             0x000000010805d58a _PyObject_MakeTpCall + 378
        11  Python3                             0x000000010814f2c2 _PyEval_EvalFrameDefault + 40930
        12  Python3                             0x000000010814be85 _PyEval_EvalFrameDefault + 27557
        13  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        14  Python3                             0x000000010805d3b4 _PyObject_FastCallDictTstate + 260
        15  Python3                             0x000000010805e0ab _PyObject_Call_Prepend + 139
        16  Python3                             0x00000001080c0ae6 _PyType_Lookup + 38086
        17  Python3                             0x00000001080b7dd4 _PyType_Lookup + 1972
        18  Python3                             0x000000010805d58a _PyObject_MakeTpCall + 378
        19  Python3                             0x000000010814f2c2 _PyEval_EvalFrameDefault + 40930
        20  Python3                             0x000000010814bf24 _PyEval_EvalFrameDefault + 27716
        21  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        22  Python3                             0x00000001080600fd PyMethod_New + 365
        23  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        24  Python3                             0x000000010814be85 _PyEval_EvalFrameDefault + 27557
        25  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        26  Python3                             0x00000001080600fd PyMethod_New + 365
        27  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        28  Python3                             0x000000010814be85 _PyEval_EvalFrameDefault + 27557
        29  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        30  Python3                             0x00000001080600fd PyMethod_New + 365
        31  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        32  Python3                             0x000000010814be85 _PyEval_EvalFrameDefault + 27557
        33  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        34  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        35  Python3                             0x00000001080600fd PyMethod_New + 365
        36  Python3                             0x000000010805d98b PyVectorcall_Call + 155
        37  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        38  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        39  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        40  Python3                             0x000000010805d98b PyVectorcall_Call + 155
        41  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        42  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        43  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        44  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        45  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        46  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        47  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        48  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        49  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        50  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        51  Python3                             0x000000010814be85 _PyEval_EvalFrameDefault + 27557
        52  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        53  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        54  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        55  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        56  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        57  Python3                             0x000000010814be61 _PyEval_EvalFrameDefault + 27521
        58  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        59  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        60  Python3                             0x000000010814be61 _PyEval_EvalFrameDefault + 27521
        61  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        62  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        63  Python3                             0x0000000108060232 PyMethod_New + 674
        64  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        65  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        66  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        67  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        68  Python3                             0x000000010814be61 _PyEval_EvalFrameDefault + 27521
        69  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        70  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        71  Python3                             0x000000010814be61 _PyEval_EvalFrameDefault + 27521
        72  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        73  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        74  Python3                             0x00000001080601a3 PyMethod_New + 531
        75  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        76  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        77  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        78  Python3                             0x0000000108060232 PyMethod_New + 674
        79  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        80  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        81  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        82  Python3                             0x0000000108060232 PyMethod_New + 674
        83  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        84  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        85  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        86  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        87  Python3                             0x000000010814be61 _PyEval_EvalFrameDefault + 27521
        88  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        89  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        90  Python3                             0x000000010814bf24 _PyEval_EvalFrameDefault + 27716
        91  Python3                             0x000000010815014e _PyEval_EvalFrameDefault + 44654
        92  Python3                             0x000000010805dcc9 _PyFunction_Vectorcall + 265
        93  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        94  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        95  Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        96  Python3                             0x000000010814be61 _PyEval_EvalFrameDefault + 27521
        97  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        98  Python3                             0x000000010814c302 _PyEval_EvalFrameDefault + 28706
        99  Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        100 Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        101 Python3                             0x000000010814be61 _PyEval_EvalFrameDefault + 27521
        102 Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        103 Python3                             0x000000010814f1ed _PyEval_EvalFrameDefault + 40717
        104 Python3                             0x000000010814be61 _PyEval_EvalFrameDefault + 27521
        105 Python3                             0x000000010805ddd3 _PyFunction_Vectorcall + 531
        106 Python3                             0x00000001080601a3 PyMethod_New + 531
        107 Python3                             0x00000001081f3177 PyInit__thread + 5799
        108 Python3                             0x00000001081a2299 PyThread_start_new_thread + 313
        109 libsystem_pthread.dylib             0x00007ff8017a3259 _pthread_start + 125
        110 libsystem_pthread.dylib             0x00007ff80179ec7b thread_start + 15
)
libc++abi: terminating with uncaught exception of type NSException
zsh: abort      python3 bot.py

Can you help me ? Run On MacOs 13.0

fouille commented 2 years ago

I have solve my problem : I've add matplotlib.use('Agg') in chart_info_file_saver.py

ebellocchia commented 2 years ago

Hi, thanks for the findings. I've never experienced that problem, but I'll check it.