简体   繁体   中英

How to import plotly on Google Colab

Hi I was trying to import plotly on GoogleColab.

I used the code import plotly.plotly as py import plotly.graph_objs as go and it returns

ImportError: The plotly.plotly module is deprecated, please install the chart-studio package and use the chart_studio.plotly module instead.

Can someone shed a bit light on this please? Thanks.

As the error says, try installing chart-sudio using:

!pip install chart_studio

Then import it like so:

import chart_studio.plotly as py
import plotly.graph_objs as go

Here is a screenshot:

在此处输入图像描述

Plotly has been updated. Try this:

import plotly.express as px

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM