Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tkinter: "Python may not be configured for Tk"

Today I wanted to start working with Tkinter, but I have some problems.

Python 3.2 (r32:88445, Mar 28 2011, 04:14:07)  [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> from tkinter import * Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.2/tkinter/__init__.py", line 39, in <module> import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter 

So how can I configure my Python 3.2 to work with Tkinter?

like image 288
Maciej Ziarko Avatar asked Mar 28 '11 13:03

Maciej Ziarko


People also ask

Why Tkinter is not working in Python?

The easiest way to fix this problem is by upgrading your python to use python 3. If upgrading python is not an option, you only need to rename your imports to use Tkinter (uppercase) instead of tkinter (lowercase). Output: As a result, this window proves that your python installation includes the Tkinter module.

What is Tk () in Tkinter Python?

Tkinter is a Python package which comes with many functions and methods that can be used to create an application. In order to create a tkinter application, we generally create an instance of tkinter frame, i.e., Tk(). It helps to display the root window and manages all the other components of the tkinter application.

Is Tk and Tkinter the same?

The tkinter package (“Tk interface”) is the standard Python interface to the Tcl/Tk GUI toolkit. Both Tk and tkinter are available on most Unix platforms, including macOS, as well as on Windows systems.


1 Answers

Under Arch/Manjaro just install the package tk:

sudo pacman -S tk 
like image 61
Jabba Avatar answered Sep 19 '22 11:09

Jabba