I’ve just begun playing around with plotly in python (Windows 10), but I’m unable to get even a simple example to render. I’m sure it’s something very basic that I’m overlooking, but haven’t found enough info to guess what it might be. Using a dead simple example cribbed from a tutorial:
import plotly.io as pio
fig = dict({
"data": [{"type": "bar",
"x": [1, 2, 3],
"y": [1, 3, 2]}],
"layout": {"title": {"text": "A Figure Specified By Python Dictionary"}}
})
# To display the figure defined by this dict, use the low-level plotly.io.show function
pio.show(fig)
I’ve tried running this two ways. From the command line:
python testplot2.py
and also from within vscode using the “Run Python file” icon from the editor window.
What I get is a new Chrome tab (or window if Chrome isn’t currently running) which is entirely blank. It has the URL:
http://127.0.0.1:51496/
I’m not sure what process is supposed to be listening on port 51496. Apparently something is because the connection request isn’t rejected immediately. The page never finished “loading” but never displays anything. When run from the command line the python process seems to be uninterruptable, at least with a Ctl-C. I’m sure I’m doing something very basic very wrong.