from matplotlib.backends import _tkagg ImportError: cannot import name _tkagg

后端 未结 5 1704
不思量自难忘°
不思量自难忘° 2021-02-05 10:53

While trying to run this example to test how matplotlib works with Tkinter, I am getting the error:

(env)fieldsofgold@fieldsofgold-VirtualBox:~/new$ python test.         


        
5条回答
  •  逝去的感伤
    2021-02-05 11:30

    Python 3.7.4 on Windows 10, replacing NavigationToolbar2TkAgg with NavigationToolbar2Tk works for me.

    Change from:

    from matplotlib.backends.backend_tkagg import ( FigureCanvasTkAgg, NavigationToolbar2TkAgg)

    To:

    from matplotlib.backends.backend_tkagg import ( FigureCanvasTkAgg, NavigationToolbar2Tk)

提交回复
热议问题