Come risolvere l'errore 'If this fails your Python may not be configured for Tk' in Python

Mattepuffo's logo
Come risolvere l'errore 'If this fails your Python may not be configured for Tk' in Python

Come risolvere l'errore 'If this fails your Python may not be configured for Tk' in Python

Ho iniziato a giocare un pò con Tkinter, il package per la costruzione di GUI di default di Python.

In sostanza Tkinter viene già installato con Python (entrambe le versioni).

Provando, però, ad eseguire un qualsiasi codice mi usciva questo errore:

If this fails your Python may not be configured for Tk

Ho scoperto che Tkinter si basa tu Tcl/tk, e quindi deve essere installato sul sistema.

Per Linux vi dovrebbe bastare guardare dentro ai vostri repo; per Archlinux vi basta questo comando:

# pacman -Sy tcl tk

A questo punto provate ad avviare il vostro programma.

Enjoy!


Condividi

Commentami!