【发布时间】:2020-10-29 17:41:11
【问题描述】:
我正在尝试使用下一个代码保存绘图线静态图像:
import plotly
import plotly.express as px
fig = px.line(EFBCg_f[1:12], x='time(ms)', y="C(n)", width=800, height=200)
fig.show()
file='Results/filename.png'
fig.write_image(file)
在站点https://plotly.com/python/static-image-export/ 中,标记为安装以下任一请求:
!pip install -U kaleido
或
conda install -c plotly python-kaleido
我用 pip 安装 kaleido 没有问题,但是创建一个空文件。
因此,我尝试使用 coda 安装 kaleido,但首先我必须安装 coda,因为它不是 Google Colab 中的本机。我进行如下操作:
!pip 安装 conda
我没有问题。然后,我运行命令:
!conda install -c plotly python-kaleido
我有下一个回复:
ERROR: The install method you used for conda--probably either `pip install conda`
or `easy_install conda`--is not compatible with using conda as an application.
If your intention is to install conda as a standalone application, currently
supported install methods include the Anaconda installer and the miniconda
installer. You can download the miniconda installer from
https://conda.io/miniconda.html.
现在,我卡住了。
如果您能帮助找出问题,我将不胜感激。谢谢你。胡安。
【问题讨论】:
-
pip install是去这里的方式。您确定问题不是您的代码吗?例如,this tutorial 中的示例是否有效?
标签: python plotly conda google-colaboratory