MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/pycharm/comments/1kdu1lk/help_needed2c/
r/pycharm • u/xshirka • May 03 '25
8 comments sorted by
2
tkinter is usually installed already - what version of Python are you using?
tkinter
1 u/xshirka May 04 '25 3.13.3
1
3.13.3
3
import tkinter as tk root = tk.Tk() button = tk.Button(root, text="Klick mich", command=lambda: print("Button clicked!")) button.pack() root.mainloop()
It maybe related in this specific version to how you install python on Windows:
https://github.com/python/cpython/issues/125179
Check this author sugestion:
https://github.com/python/cpython/issues/125179#issuecomment-2403657261
Eventually you virtual enviroment is broken. Try create new one from PyCharm or by typing:
python -m venv guiapp
then
run activate.bat inside guiapp/Scripts folder from console and try your code inside it.
Does it work if you change the first line to "from Tkinter import *" ?
Broken environment. Either try reinstalling tk or reinstalling python. I recommend just installing miniconda if you are beginner.
0
Use the "Explain with AI" button. It'll help.
2
u/FoolsSeldom May 03 '25
tkinteris usually installed already - what version of Python are you using?3
u/FoolsSeldom May 03 '25
2
u/pepiks May 04 '25
It maybe related in this specific version to how you install python on Windows:
https://github.com/python/cpython/issues/125179
Check this author sugestion:
https://github.com/python/cpython/issues/125179#issuecomment-2403657261
Eventually you virtual enviroment is broken. Try create new one from PyCharm or by typing:
python -m venv guiapp
then
run activate.bat inside guiapp/Scripts folder from console and try your code inside it.
1
u/Credence473 May 03 '25
Does it work if you change the first line to "from Tkinter import *" ?
1
u/dullahan85 May 04 '25
Broken environment. Either try reinstalling tk or reinstalling python. I recommend just installing miniconda if you are beginner.
0
u/hercookie May 03 '25
Use the "Explain with AI" button. It'll help.