我试图使用下面的代码来保存一个平缓的行静态映像:
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中的本地。我的发言如下:
!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.现在我卡住了。
如果你能帮我找出问题,我很感激。谢谢。胡安。
发布于 2022-05-25 20:48:38
要在Google中巧妙地保存图像,首先运行:
!pip install -U kaleido然后转到菜单中的Runtime > Restart Runtime。
重新启动运行时后,重新运行代码。(您不需要重新运行pip命令)。
有关为什么在Google中安装软件包有时需要重新启动运行时,请参见this discussion。
发布于 2022-03-05 19:33:37
试试这个(tnx到Greg https://youtu.be/qNF1HqBvpGE)
!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
!apt-get install xvfb libgtk2.0-0 libgconf-2-4https://stackoverflow.com/questions/64596502
复制相似问题