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

后端 未结 5 1711
不思量自难忘°
不思量自难忘° 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:22

    Try following this scenario:

    sudo apt-get update
    
    sudo apt-get install tk tk-dev
    
    sudo pip uninstall matplotlib 
    
    sudo pip install matplotlib
    

    EDIT:

    Try:

    sudo pip uninstall matplotlib 
    
    sudo apt-get install python-matplotlib
    

    EDIT2:

    sudo apt-get install tk8.6-dev
    
    sudo apt-get remove python-matplotlib
    
    sudo apt-get install python-matplotlib
    

提交回复
热议问题