Blank output instead of plots with Google AI platform

Hello!

I’ve created new notebook with Google AI platform “TensorFlow 1.14” and tried plotly code with jupiter notebook. Python 2 and Python 3.

Blank output instead of plots.

import plotly.graph_objects as go
fig = go.Figure(data=go.Bar(y=[2, 3, 1]))
fig.show()

I tried with chrome and safari browsers.

I share a solution found here. This function fix the problem:

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>
                '''))

You have just to call it once in the notebook.