[英]Plotly Static Image Export gets OSError: [WinError 193] %1 is not a valid Win32 application
Getting this error every time I run my code. 每次我运行代码时都会收到此错误。 I've tried make it work but it just won't stop giving me this error.
我已经尝试过使其工作,但是它不会停止地给我这个错误。
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')
I just want to be able to export the images. 我只希望能够导出图像。
After posting my comment above I went further down the rabbit hole. 在上面发表我的评论之后,我进一步走了下去。
In the end I uninstalled orca from npm. 最后,我从npm卸载了orca。 I updated my conda with
conda update conda
, completely uninstalled plotly and plotly-conda, and then finally did a pip install plotly
, and conda install -c plotly plotly-orca
. 我用
conda update conda
conda conda update conda
,完全卸载了plotly和plotly-conda,然后终于做了pip install plotly
和conda install -c plotly plotly-orca
。
For some reason this led conda to do to a massive update of all of my packages (including deleting some like pandas). 由于某种原因,这导致conda对我的所有软件包进行了大规模更新(包括删除一些类似的pandas)。 So far this hasn't broken any old code, and plotly-orca works.
到目前为止,这还没有破坏任何旧代码,plotly-orca可以正常工作。 Insert eyeroll emoji here.
在此处插入眼球表情符号。 I really hope it works for you.
我真的希望它对您有用。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.