简体   繁体   English

如何在 Google Colab 上导入 plotly

[英]How to import plotly on Google Colab

Hi I was trying to import plotly on GoogleColab.嗨,我试图在plotly上导入 plotly。

I used the code import plotly.plotly as py import plotly.graph_objs as go and it returns我使用了代码import plotly.plotly as py import plotly.graph_objs as go

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:正如错误所说,尝试使用以下方法安装chart-sudio

!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. Plotly 已更新。 Try this:尝试这个:

import plotly.express as px

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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