我使用Colab和Plotly,我想保存一个Plotly图形-如何在Colab中安装plotly-orca?

时间:2019-03-11 20:17:26

标签: python jupyter-notebook google-colaboratory

我在下面收到错误消息。

如果尚未安装orca,则可以使用conda进行安装,如下所示:

$ conda install -c plotly plotly-orca

或者,请参见orca项目README中的其他安装方法,网址为: https://github.com/plotly/orca

我尝试过: !pip install plotly-orca,但这会引发错误。

收集plotly-orca   找不到满足plotly-orca要求的版本(来自版本:) 找不到针对plotly-orca的匹配分布

我想做什么:

  • 在Google云端硬盘中本地保存Plotly图形

2 个答案:

答案 0 :(得分:0)

要将iplotly图形另存为html到gdrive

# Connecting to GDrive
from google.colab import drive
drive.mount('/content/gdrive')

from plotly.offline import iplot, plot, download_plotlyjs, init_notebook_mode
import plotly.graph_objs as go


Tickets_plot = go.Figure( ..... whatever is normally for your Plotly graph ....)

# this saves it to Google Drive ...you can put it in any folder you like
plot(Tickets_plot, filename="/content/drive/test.html", auto_open=False)

# this saves it within the notebook folder locallhy
plot(Tickets_plot, filename="/content/drive/test.html", auto_open=False)

答案 1 :(得分:0)

我用了这个:

!pip install plotly==4.4.1
!wget https://github.com/plotly/orca/releases/download/v1.2.1/orca-1.2.1-x86_64.AppImage -O /usr/local/bin/orca
!chmod +x /usr/local/bin/orca