python - Plotly 静态图像导出出现 OSError : [WinError 193] %1 is not a valid Win32 application

标签 python plotly orca

每次运行代码时都会出现此错误。我已经尝试让它工作,但它只是不会停止给我这个错误。

if not os.path.exists('images'):
    os.mkdir('images')
init_notebook_mode(connected=True)
N = 100
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)
sz = np.random.rand(N) * 30

fig = go.Figure()
fig.add_scatter(x=x, y=y, mode='markers', marker={'size': sz, 'color': colors, 'opacity': 0.6,
                'colorscale': 'Viridis'})
pio.write_image(fig, r'images\fig1.png')

我只是希望能够导出图像。

最佳答案

在上面发表评论后,我进一步深入了兔子洞。

最后我从 npm 卸载了 orca。我用 conda update conda 更新了我的 conda ,彻底卸载了plotly和plotly-conda,然后最后做了个pip install plotly ,和conda install -c plotly plotly-orca

由于某种原因,这导致 conda 对我的所有软件包进行了大规模更新(包括删除一些像 pandas 的软件包)。到目前为止,这还没有破坏任何旧代码,并且plotly-orca 可以工作。在此插入翻白眼表情符号。我真的希望它对你有用。

关于python - Plotly 静态图像导出出现 OSError : [WinError 193] %1 is not a valid Win32 application,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56600645/

相关文章:

wix - Windows Installer和WiX的创建

windows-installer - 在执行卸载之前停止 Windows 服务

python - 0 写入文件时出现十六进制错误?

python - Pandas 将多行作为一行,添加特定列

python - 如何转换 ~/.路径到绝对路径

python - 防止链式回调将下拉菜单切换为原始值破折号

r - 图表上的多个 Y 轴未对齐

python - 将 Pandas 对象与 Plotly ValueError 一起使用

python - 计算屏幕DPI

windows-installer - DISABLEADVTSHORTCUTS=1 禁用所有快捷方式