简体   繁体   中英

Installing tkMessageBox on Python2.7

Does anyone happen to know how I can install tkMessageBox on Python2.7? I'm trying to run some Tkinter scripts that I've found, and I need the tkMessageBox to do so. I tried "pip install tkMessageBox" and got a message that said no package by that name could be found. I also tried looking on Christoph Gohlke's site for an installer, but no luck. I've read that tkMessageBox has changed names in Python3.x--can I pip install it by using a different name? Any help others can offer would be most appreciated. (In case it matters, I'm working in Windows 8.)

It comes with Tkinter, it's not a separate package. If you have tkinter, you have tkmessagebox. However, it has been renamed in python 3

python 2.x:

import Tkinter
import tkMessageBox

python 3.x:

from tkinter import messagebox as tkMessageBox

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM