I found in this video a way to enable plotly outputs on JupyterLab on every venv.
You have just to call once this function in the notebook:
def configure_plotly_browser_state():
display(IPython.core.display.HTML('''
<script src="/static/components/requirejs/require.js"></script>
<script>
requirejs.config({
paths: {
base: '/static/base',
plotly: 'https://cdn.plot.ly/plotly-1.5.1.min.js?noext',
},
});
</script>
'''))
I have no knowledge of js and HTML, so I ignore what this script is doing. But this method looks simpler than the official solution proposed here in the plotly python API.
Furthermore, with this method, you don’t make permanent changes in your venv. It is also the only way (as far as I know) to get plotly working on a proprietary environment like GCP AI-platform notebooks.
Am I missing something?