Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python

Josh Keenan
Josh Keenan
19,652 Points

Pip struggles

So I am trying to install tkMessageBox and pip won't do it, I get this error.

** Could not find a version that satisfies the requirement tkMessageBox (from versions: ) No matching distribution found for tkMessageBox **

I was wondering if anyone knew how to fix it or work around it

1 Answer

Chris Freeman
MOD
Chris Freeman
Treehouse Moderator 68,423 Points

It looks like tkmessagebox is built into tkinter so you shouldn't need to pip install it. Note the name change between Py2 and Py3.

From [askubuntu.com](http://askubuntu.com/questions/379366/python-3-2-script-not-working-and-or-importing-tkinter-when-running-from-desktop:

# For Python 2 try:
import tkMessageBox
import tkSimpleDialog

msg = tkMessageBox
sdg = tkSimpleDialog

# or simpler:

import tkMessageBox as msg
import tkSimpleDialog as sdk

# For Python 3 try:
from tkinter import messagebox
from tkinter import simpledialog

msg = messagebox
sdg = simpledialog

# or simpler:

from tkinter import messagebox as msg
from tkinter import simpledialog as sdg
Josh Keenan
Josh Keenan
19,652 Points

Thank you Chris, can't believe I didn't think of that..