this is the most common problem encountered with python + matplotlib. The issue would be mostly related to missing GUI dependency libraries. You need to install an appropriate GUI framework like Tkinter / QT for python and then set an backend for matplotlib to use.
Search for it. Stackoverflow has got them already.