Matplotlib Crashing tkinter Application

前端 未结 5 1374
滥情空心
滥情空心 2020-12-01 04:34

I am building an application that embeds a matplotlib figure into the GUI. The problem is that my app is crashing as soon as I add anything from matplotlib into my code (ex

5条回答
  •  南笙
    南笙 (楼主)
    2020-12-01 05:20

    If you don't want to edit the code, you can use set the following environment variable that matplotlib is reading:

    MPLBACKEND=TkAgg
    

    This way, no matter when you import pyplot, it'll work

提交回复
热议问题