My question is very similar to this
but I couldn’t find an answer after searching this and other forums.
I’ve been using plotly.py in a virtual environment and got used to rendering plotly figures in the browser, to quickly visualize data, debug stuff, and so on.
I’m now trying to use the same setup, except the python environment is in a docker container.
Calls to fig.show() fail with the error webbrowser.Error: could not locate runnable browser; which makes sense because plotly within the container has no visibility on the host’s browser and available ports.
I’ve found several solutions to (sort of) doing this when using dash, but in that case one knows the app’s port and it can be mapped to an available port on the host; whereas my understanding is that the browser uses any available port at the time that fig.show() is invoked.
I’ve also read about using fig.write_html(‘tmp.html’, auto_open=True) instead, and it sort of works except the auto_open option does not work, presumably for the same reason why show() fails.
Overall I feel dash is great but quite an overkill for quick data exploration, and write_html() is a bit cumbersome; so I’d really like to know if one can still get fig.show() to render in the browser when plotly is installed in a docker container.