How to pip or easy_install tkinter on Windows

前端 未结 12 800
你的背包
你的背包 2020-11-28 22:31

My Idle is throwing errors that and says tkinter can\'t be imported.

Is there a simple way to install tkinter via pip or

12条回答
  •  忘掉有多难
    2020-11-28 22:47

    The Tkinter library is built-in with every Python installation. And since you are on Windows, I believe you installed Python through the binaries on their website?

    If so, Then most probably you are typing the command wrong. It should be:

    import Tkinter as tk
    

    Note the capital T at the beginning of Tkinter.

    For Python 3,

    import tkinter as tk
    

提交回复
热议问题