I got the error because I deselected tcl. I came here looking for an answer to this same question and none of the answers above actually answer the question at all!
Personally I find this very annoying as i'm packaging a python application to be installed via pip that uses tkinter and I was looking for a way to have pip ensure that tkinter is installed and the answer is I can't I have to instruct users to install it if it's not installed already, a very poor experience for end users who should not need to know or care what tkinter is to use my application.
The solution is to repair the installation via uninstall GUI is fine , and select to install tk this time. You may need to point at or redownload the binary in this process. Downloading directly from activestate did not work for me. When you run this, DDL should be installed like so:. I had the similar problem with Win-8 and python The import tkinter should work.. Button you just type Button.
How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 8 years, 1 month ago. Active 6 months ago. Viewed k times. My Idle is throwing errors that and says tkinter can't be imported. There seem to be a lot of package names flying around for this This and other assorted variations with tkinter-pypy aren't working. Improve this question.
Dirk Calloway Dirk Calloway 2, 4 4 gold badges 20 20 silver badges 33 33 bronze badges. Add a comment. Active Oldest Votes. 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. Improve this answer. User 7 7 silver badges 20 20 bronze badges. IcyFlame IcyFlame 4, 16 16 gold badges 45 45 silver badges 73 73 bronze badges. Now we can see if it works. How do I run tkinter in Pycharm? Tkinter will be imported. How do I enable tkinter in Python? Macintosh Install Python. According to python. Install Swampy. What is a tkinter in Python? Tkinter is not the only GuiProgramming toolkit for Python.
It is however the most commonly used one. How do you update Python? If you are upgrading any 3. Since you already have Python installed on your machine installer will prompt you for "Upgrade Now".
Click on that button and it will replace the existing version with a new one. How do I install swampy for Python 3? Installing Swampy Unzip it. The unzipped folder is called "swampy Determine the location of the Python 3 "site-packages" folder on your machine. On a Mac: select and copy the name of the site-packages folder.
On my machine it was. Does tkinter work on Linux? You should read the licensebefore downloading to verify that your usage complies with its terms of use. This release is included in macOS As of this writing,there are at least two known issues with Tk 8. The more serious problem is an immediate crash in Tkwhen entering a composition character, like Option-u on a US keyboard.
This problem is documented asTk bug You can avoid these problems by using a current python. IDLE is known to hang or crashwhen used with the Apple 8. Instead, install a newer version ofPython that supports a newer version of Tk. While Tcl and Tk areseparate frameworks and libraries, they are closely related and arenormally installed or updated simultaneously.
You should notattempt to mix-and-match Tcl and Tk versions. References toa specific version of Tk assume the corresponding version of Tcl is installed as well. All current python. This is the standard location for third-partyor built from source frameworks, including the ActiveTcl releases. As is common on macOS, the installed Pythons and the Tcl and Tkframeworks are built to run on multiple CPU architectures universalbinaries and across multiple macOS levels minimum deploymenttarget.
Aqua Cocoa Tk A newer native implementation availableas a universal bit and bit binary.
0コメント