Plotly to open a chart in Microsoft Edge

Viewed 631

I am new to using plotly, and I have been able to create a Gantt chart, however, the chart does not always load in Google Chrome, but it always loads in Microsoft Edge.

Here is my code that works when I set Edge as my default browser.

import plotly.figure_factory as ff
import plotly.offline as py
df = [dict(Task="Job A", Start='2020-01-01', Finish='2020-02-28'),
      dict(Task="Job B", Start='2020-03-05', Finish='2020-04-15'),
      dict(Task="Job C", Start='2020-02-20', Finish='2020-05-30')]
fig = ff.create_gantt(df)
py.iplot(fig,filename='test')

In Chrome I get the error that the site can't be reached and the console says "Chrome not allowed to load local resource".

I have tried rendering the graph in a "pdf" but I get the following in my console.

{'application/pdf': 'JVBERi0xLjQKJd...'}

I tried rendering it in Chrome and I get this error:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\testUser\Miniconda3\lib\tkinter\__init__.py", line 1705, in __call__
    return self.func(*args)
  File "C:/Users/testUser/Desktop/NewestVersionsofApps/NWO3/WorkOrderApplication.py", line 102, in genSched
    fig.show(renderer='chrome')
  File "C:\Users\testUser\Miniconda3\lib\site-packages\plotly\basedatatypes.py", line 2794, in show
    return pio.show(self, *args, **kwargs)
  File "C:\Users\testUser\Miniconda3\lib\site-packages\plotly\io\_renderers.py", line 391, in show
    renderers._perform_external_rendering(fig_dict, renderers_string=renderer, **kwargs)
  File "C:\Users\testUser\Miniconda3\lib\site-packages\plotly\io\_renderers.py", line 340, in _perform_external_rendering
    renderer.render(fig_dict)
  File "C:\Users\testUser\Miniconda3\lib\site-packages\plotly\io\_base_renderers.py", line 736, in render
    open_html_in_browser(html, self.using, self.new, self.autoraise)
  File "C:\Users\testUser\Miniconda3\lib\site-packages\plotly\io\_base_renderers.py", line 681, in open_html_in_browser
    webbrowser.get(using).open(
  File "C:\Users\testUser\Miniconda3\lib\webbrowser.py", line 65, in get
    raise Error("could not locate runnable browser")
webbrowser.Error: could not locate runnable browser

I am wondering what can I do to always have it open in Microsoft Edge, regardless of the default browser, and more importantly why won't it load in Chrome?

0 Answers
Related