Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 661
nilsinelabore Avatar asked Dec 01 '22 13:12

nilsinelabore


2 Answers

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:

enter image description here

like image 152
Anwarvic Avatar answered Dec 05 '22 05:12

Anwarvic


Plotly has been updated. Try this:

import plotly.express as px
like image 45
sargupta Avatar answered Dec 05 '22 06:12

sargupta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!