Idle can import tkinter mac
It works for me. Add a comment. Active Oldest Votes. This is a Mac-only error, and as per user 's comment, running brew install python-tk will work as long as you have home-brew installed on your machine. If you decide, for some good reason that I have not thought of, not to use homebrew, you can also fix this with sudo apt-get install python3-tk if you have chosen to go the Ubuntu-based package manager route.
Improve this answer. Shep sims Shep sims 3 3 silver badges 14 14 bronze badges. Sven Eberth 2, 11 11 gold badges 21 21 silver badges 27 27 bronze badges. Ngoc Nguyen Ngoc Nguyen 2 2 silver badges 5 5 bronze badges. Sign up or log in Sign up using Google. You can avoid these problems by using a current python. IDLE is known to hang or crash when used with the Apple 8. Instead, install a newer version of Python that supports a newer version of Tk.
While Tcl and Tk are separate frameworks and libraries, they are closely related and are normally installed or updated simultaneously.
You should not attempt to mix-and-match Tcl and Tk versions. References to a specific version of Tk assume the corresponding version of Tcl is installed as well. All current python. This is the standard location for third-party or built from source frameworks, including the ActiveTcl releases.
As is common on macOS, the installed Pythons and the Tcl and Tk frameworks are built to run on multiple CPU architectures universal binaries and across multiple macOS levels minimum deployment target.
PS stackoverflow is awesome. If google brought you to this article, spend some time and surf around the site. If you installed python-tk and the system is running python 2. Try installing python3-tk. IDLE can't import Tkinter. Your Python may not be configured for Tk. I typed idle3. Any input would be appreciated. This tutorial assumes Python 3. There are some significant differences between the two, including module naming, which is the first thing you'll encounter when trying Tkinter.
As of this writing, the latest 3. If you're using Python 3. When compiling Python versions prior to 3. The first provides the locations of the Tcl and Tk include files, and the second provides the locations of the Tcl and Tk libraries.
These are usually found in two different locations i. You therefore need to provide two locations for the include files and two for the libraries.
Note the location of the quotes in the command below and the spaces separating the Tcl and Tk paths. When I tried to use tkinter from python installed using pyenv on Mac, I got the following error.
0コメント