Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[ Bug] TclError with PySimpleGUI, Python 3.13 and tcl-tk 9.0.0_1

Aperta
#6,822 36 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
python
Ambito
desktop

Direzione di ricerca

Inizia eseguendo l'esempio PySimpleGUI fornito con Python 3.13 e tcl-tk 9.0.0_1 su macOS 14.7, quindi confrontalo con Python 3.11 e tcl-tk 8.6.15. Traccia il _tkinter.TclError segnalato e verifica che la finestra di esempio funzioni senza l'errore per le versioni interessate.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Done - Install Dev Build (see docs for how) Platform Specific Issue - Mac Port - TK
Type of Issue (Enhancement, Error, Bug, Question)

Bug


Operating System

MacOS 14.7 (arm)

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions (NOTE - PSG4 is no longer supported)

Python 3.13.0
PySimpleGUI version: 5.0.7
tcl-tk 9.0.0_1
python-tk 3.13.0


Your Experience In Months or Years (optional)

5+

Years Programming experience overall

10+

Anything else you think would be helpful?

Error reported: _tkinter.TclError: bad option "variable": must be add, info, or remove


Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem PySimpleGUI Documenation
  • Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demo Programs
  • None of your GUI code was generated by an AI algorithm like GPT
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.com
  • Have upgraded to the latest release of PySimpleGUI on PyPI (latest official version)
  • Tried running the Development Build. Your problem may have already been fixed but not released. Check Home Window for release notes and upgrading capability
  • For licensing questions please email license@PySimpleGUI.com
Detailed Description

Using Python 3.13 with tcl-tk version 9.0.0_1 causes the error _tkinter.TclError: bad option "variable": must be add, info, or remove

Reverting to Using Python 3.11 with tcl-tk version 8.6.15 works without error

Code To Duplicate

Installing the older version of tcl-tk with python 3.11 allows PySimpleGUI to work, it doesn't seem to work when python 3.12 or python3.13 is used with tcl-tk 9.0.0_1

Sample code from the site was used to test:


import PySimpleGUI as sg

# All the stuff inside your window.
layout = [  [sg.Text('Some text on Row 1')],
            [sg.Text('Enter something on Row 2'), sg.InputText()],
            [sg.Button('Ok'), sg.Button('Cancel')] ]

# Create the Window
window = sg.Window('Window Title', layout)

# Event Loop to process "events" and get the "values" of the inputs
while True:
    event, values = window.read()
    if event == sg.WIN_CLOSED or event == 'Cancel':	# if user closes window or clicks cancel
        break
    print('You entered ', values[0])

window.close()



Watcha Makin?

Testing PySimpleGUI

Lingua principale
Python
Stelle
13.8k
Fork
1.8k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di PySimpleGUI/PySimpleGUI

Tutte le issue di PySimpleGUI/PySimpleGUI

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.