How to import plotly on Google Colab

£可爱£侵袭症+ 提交于 2020-05-11 17:39:33

问题


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.


回答1:


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:




回答2:


Plotly has been updated. Try this:

import plotly.express as px


来源:https://stackoverflow.com/questions/58073760/how-to-import-plotly-on-google-colab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!