将图形保存到fi时出现绘图错误

2024-05-18 07:13:03 发布

您现在位置:Python中文网/ 问答频道 /正文

我在ubuntu服务器上运行python代码,在将plotly图像保存到文件时,通过调用函数

fig.to_image(format='png')

我得到这个错误:

E               ValueError:
E               For some reason plotly.py was unable to communicate with the
E               local orca server process, even though the server process seems to be running.
E
E               Please review the process and connection information below:
E
E               orca status
E               -----------
E                   state: running
E                   executable: /usr/bin/xvfb-run --auto-servernum --server-args -screen 0 640x480x24 +extension RANDR +extension GLX /home/user/miniconda3/envs/env_test/bin/orca
E                   version: 1.2.1
E                   port: 41057
E                   pid: 94611
E                   command: ['/usr/bin/xvfb-run', '--auto-servernum', '--server-args', '-screen 0 640x480x24 +extension RANDR +extension GLX', '/home/user/miniconda3/envs/env_test/bin/orca', 'serve', '-p', '41057', '--plotly', '/home/user/miniconda3/envs/env_test/lib/python3.7/site-packages/plotly/package_data/plotly.min.js', '--graph-only', '--mathjax', 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js']

../../miniconda3/envs/env_test/lib/python3.7/site-packages/plotly/io/_orca.py:1529: ValueError

有人能解决这个问题吗


Tags: thetotestenvhomebinserverextension