New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling savefig() multiple times causes crash of Spyder IDE / IPython Kernel dying. #12409
Comments
If you need spyder and/or ipython to trigger this bug I’d suggest the bug is elsewhere. If you can trigger from bare python please comment here and we can reopen. My guess is something is wrong w your install. |
Hi again, I just ran into similar problems when executing the script via the windows command prompt. I used import matplotlib.pyplot as plt
plt.ioff()
fig = plt.figure()
for i in range(20):
x=[1,2,3]
y=[3,4,5]
ax = fig.add_subplot(111)
ax.plot(x,y)
plt.savefig("C:\\Users\\RHu\\Desktop\\plotfolder\\" + 'test{0:0d}.png'.format(i))
plt.clf()
print(i) # for debugging
plt.close() In this configuration, I realized the script only runs properly if the *.png files are not already present in the target directory. So, if the script is run with an empty target folder, the plots are saved just fine. If you then run the script again, it just prints 0 and 1 and then stops. I also saw something else: The problem only ever occurs for the *.png file format. With the *.jpg and *.pdf extensions, everything works as it should, also in Spyder. I think this might be a problem with the new Windows feature update from friday. Our IT told me the update was actually called back, so hopefully the next Windows update will fix it without you having to do anything. I'll just be using *.jpg format until then. |
Hey again, so the bug was solely created by the bad Windows 10 v. 1809 Update. It was actually supposed to have been called back for the Windows Professional version, but due to an internal error by Microsoft it was released anyways. So you can consider this issue resolved. We just reset the Windows version to the previous state and now everything works fine again. Thank you for your efforts anyways! |
Bug report
Bug summary
Calling savefig() multiple times causes crash of Spyder IDE / IPython Kernel dying. The first time, the image is usually saved and sometimes even a couple more times, but eventually it causes a crash.
Yesterday everything still worked fine, today after a Windows update savefig started making these problems. The issue is independent of the target directory.
Code for reproduction
Actual outcome
Spyder crashes or the IPython Kernel dies. Some figures are saved until it suddenly crashes.
Expected outcome
Saving figures.
Matplotlib version
print(matplotlib.get_backend())
): module://ipykernel.pylab.backend_inlineThe text was updated successfully, but these errors were encountered: