Problems with Interactive Plotting in Debug Mode in PyCharm Version 2017.1


In earlier Versions of PyCharm it was possible to interactively plot a figure with matplotlib in the debug console without blocking the console. Example:

  • plt.imshow(2dgrid) 

directly opened the figure. I could do it several times to look at different results while in debugging mode.


Since 2017.1 I have to manually call show() which then blocks the console until the figure is destroyed. Example: 

  • plt.imshow(2dgrid) 

Without the figure does not open up. Additionallay blocks the console. Trying crashes the figure. Process finished with exit code -805306369 (0xCFFFFFFF)

I hope my problem is comprehensible. Is this a bug under Version  2017.1? 


I am having the exact same problem.  Makes me regret switching to 2017.1 from 2016.3 because I use plotting in the debugger as my primary tool.


There is already a solution for this problem:

In PyCharm go to:

  • Run --> Edit Configurations --> Add Environment Variabes "Display True"


works for me now, thanks for pointing to the solution.


I am still having troubles with matplotlib, even doing what is recommended here. I need help.


You can show the plots in a separate window using the hint from

.... Check you have an option "Show plots in toolwindow" enabled in Settings | Tools | Python Scientific. After that you can run a script which contains call and your graph will appear in a tool window "SciView". 


I am also facing this problem on version  PyCharm 2021.3.1 (Community Edition). And the fix (adding env, DISPLAY = True) does not help.

And it seems below link is also broke.

Can someone help me on this ?





Please sign in to leave a comment.