matplotlib error - no module named tkinter

后端 未结 16 1666
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 04:10

I tried to use the matplotlib package via Pycharm IDE on windows 10. when I run this code:

from matplotlib import pyplot

I get the followin

16条回答
  •  执念已碎
    2020-11-28 04:25

    you can use

    import matplotlib
    matplotlib.use('agg')
    import matplotlib.pyplot as plt
    

    if you dont want to use tkinter at all.

    Also dont forget to use %matplotlib inline at the top of your notebook if using one.

    EDIT: agg is a different backend like tkinter for matplotlib.

提交回复
热议问题