tkagg backend problems

前端 未结 2 1582
萌比男神i
萌比男神i 2021-01-17 10:28

I need to use the Tkagg backent to use matplotlib in a Tkinter program, and I received the \"ImportError: No module named backend_tkagg\" error message.

Looking arou

相关标签:
2条回答
  • 2021-01-17 11:10

    I had this issue today.

    By default, Tkagg was not available for me (Ubuntu 14.04), so I ran:

    sudo apt-get install tk-dev libpng-dev libffi-dev dvipng texlive-latex-base
    

    Then uninstalled and reinstalled matplotlib:

    pip uninstall matplotlib
    pip install matplotlib
    
    0 讨论(0)
  • 2021-01-17 11:15

    I solved it by compiling matplotlib from source. It has Tkagg active by default. Only problem was it didn't compile Tkagg since I didn't have tk-devel installed... after installing it everything went ok.

    So I still don't know if easy_install matplotlib doesn't use TkAgg by design, or if it too checked and noticed that I didn't have Tk.h installed, but anyway this is the way to go.

    0 讨论(0)
提交回复
热议问题