The backend Qt5agg is interactive backend appears when you import the Matplotlib.pyplot as plt in the Pycharm python console. Turning interactive mode on. or other errors related to Qt5agg, causing the program to break.
Although it is not yet clear how the Qt5agg problem is solved, one can circumvent the problem (my environment is: pycharm 2017.2.3, PyQt5 5.9, PyQt4 4.11.4, Matplotlib 2.1.0, Ipython 5.3.0, Anaconda3, Python 3.6.0).
First of all, you can simply update the library of your environment, such as matplotlib, to ensure that your own matplotlib contains Tkagg. Modify the MATPLOTLIBRC file using the command Conda update matplotlib. The location of the file is in C:\ProgramData\Anaconda3\pkgs\matplotlib-2.1.0-py36h11b4b9c_0\Lib\site-packages. When you open the file, you will see the following text in about 30 lines. Modify the Qt5agg to Tkagg and save.
# the default backend; One of GTK Gtkagg Gtkcairo Gtk3agg Gtk3cairo
# MacOSX Qt4agg qt5agg tkagg WX wxagg Agg Cairo gdk PS PDF SVG
# Template.
# can also deploy your own backend outside of Matplotlib by
# referring to the module name (which must is in the Pythonpath) as
# ' Module://my_backend '.
#
# If You are omit this parameter, it'll always default to ' Agg ', which is a
# non-interactive Backend.
# Backend:qt5agg # Original
Backend:tkagg # New
If you want to import the Matplotlib.pylab as PLT, the backend Qt5agg is interactive backend does not appear. Turning interactive mode on. , you can modify the above file roughly 73 lines, the #interactive:false modified to interactive:true save. Then restart Pycharm, when the import Matplotlib.pylab as PLT, the normal operation.