【问题标题】:I use Colab and Plotly and I want save a Plotly figure - how to install plotly-orca in Colab?我使用 Colab 和 Plotly,我想保存一个 Plotly 图 - 如何在 Colab 中安装 plotly-orca?
【发布时间】:2019-03-11 20:17:25
【问题描述】:
我收到以下错误消息。
如果您还没有安装 orca,您可以使用 conda 进行安装,如下所示:
$ conda install -c plotly plotly-orca
或者,请参阅 orca 项目 README 中的其他安装方法
https://github.com/plotly/orca.
我试过了:
!pip install plotly-orca,但这会引发错误。
收集情节-逆戟鲸
找不到满足 plotly-orca 要求的版本(来自版本:)
没有找到 plotly-orca 的匹配分布
我想做什么:
- 在 Google Drive 中本地保存 Plotly 图
【问题讨论】:
标签:
python
jupyter-notebook
google-colaboratory
【解决方案1】:
将 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)
【解决方案2】:
我用过这个:
!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