OpenBB-finance / OpenBB

Investment Research for Everyone, Everywhere.
https://openbb.co
Other
33.81k stars 3.08k forks source link

[Bug] Craches Tkinter.TclError #286

Closed michucz closed 3 years ago

michucz commented 3 years ago

Describe the bug As in #221, crashes when trying to view a Ticker

To Reproduce

  1. Follow Installation Instructions,
  2. load Ticker,
  3. try to view Ticker

Screenshots N/A

Desktop (please complete the following information):

Additional context Full Terminal Output

Welcome to Gamestonk Terminal 🚀

What do you want to do?
   help        help to see this menu again
   quit        to abandon the program

   clear       clear a specific stock ticker from analysis
   load        load a specific stock ticker for analysis
   candle      view a candle chart for a specific stock ticker
   view        view and load a specific stock ticker for technical analysis

Stock: ?
Market CLOSED.

Menus:
   disc        discover trending stocks,         e.g. map, sectors, high short interest
   mill        papermill menu,                   menu to generate notebook reports
   fred        economic data,                    from: Federal Reserve Bank of St. Louis
   pa          portfolio analysis,               Currently Supported: Robinhood

(✨)> load -t GME
Loading Daily GME stock with starting period 2015-01-01 for analysis.

(✨)> view
Traceback (most recent call last):
  File "terminal.py", line 276, in <module>
    main()
  File "terminal.py", line 167, in main
    view(l_args, s_ticker, s_start, s_interval, df_stock)
  File "/home/michucz/GamestonkTerminal/gamestonk_terminal/main_helper.py", line 407, in view
    plot_view_stock(df_stock.iloc[:, ln_col_idx], ns_parser.s_ticker)
  File "/home/michucz/GamestonkTerminal/gamestonk_terminal/helper_funcs.py", line 44, in plot_view_stock
    _, axVolume = plt.subplots(figsize=plot_autoscale(), dpi=cfgPlot.PLOT_DPI)
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/pyplot.py", line 1177, in subplots
    fig = figure(**fig_kw)
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/pyplot.py", line 540, in figure
    figManager = new_figure_manager(num, figsize=figsize,
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 3358, in new_figure_manager
    return cls.new_figure_manager_given_figure(num, fig)
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py", line 905, in new_figure_manager_given_figure
    manager = cls.FigureManager(canvas, num, window)
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py", line 433, in __init__
    self.toolbar = self._get_toolbar()
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py", line 448, in _get_toolbar
    toolbar = NavigationToolbar2Tk(self.canvas, self.window)
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py", line 528, in __init__
    NavigationToolbar2.__init__(self, canvas)
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/backend_bases.py", line 2708, in __init__
    self._init_toolbar()
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py", line 589, in _init_toolbar
    button = self._Button(text=text, file=image_file,
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/site-packages/matplotlib/backends/_backend_tk.py", line 562, in _Button
    b = tk.Button(
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/tkinter/__init__.py", line 2650, in __init__
    Widget.__init__(self, master, 'button', cnf, kw)
  File "/home/michucz/anaconda3/envs/gst/lib/python3.8/tkinter/__init__.py", line 2572, in __init__
    self.tk.call(
_tkinter.TclError: expected integer but got "Nerd"

I am using Arch Linux with i3gaps

aia commented 3 years ago

Seems like this is something that i3gaps does https://bbs.archlinux.org/viewtopic.php?id=264333.

I open a PR to gracefully handle the exception.

michucz commented 3 years ago

Apparently it was my font. I use 'Hack Nerd Font' and after changing it to 'LiberationSans-Regular' in my .Xresources, i can view plots and candles charts.