#🔒 Fedora tkinter not found when it is installed

10 messages · Page 1 of 1 (latest)

desert carbon
#

For some odd reason when running the code in pycharm it says cannot find tkinter when I've installed it in the console fine. What is the problem?

import customtkinter

customtkinter.set_appearance_mode("dark")
customtkinter.set_default_color_theme("dark-blue")

root = customtkinter.CTk()
root.geometry("500x350")


def login():
    print("Test")


frame = customtkinter.CTkFrame(master=root)
frame.pack(pady=20, padx=60, fill="both", expend=True)

label = customtkinter.CTkLabel(master=frame, text="Login System", text_font=("Roboto", 24))
label.pack(pady=12, padx=10)

entry1 = customtkinter.CTkEntry(master=frame, placeholder_text="Username")
entry1.pack(pady=12, padx=10)

entry2 = customtkinter.CTkEntry(master=frame, placeholder_text="Password", show="*")
entry2.pack(pady=12, padx=10)

button = customtkinter.CTkButton(master=frame, text="Login", command=login)
button.pack(pady=12, padx=10)

checkbox = customtkinter.CTkCheckBox(master=frame, text="Remember Me")
checkbox.pack(pady=12, padx=10)

root.mainloop()

cinder basaltBOT
#

@desert carbon

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

modern yacht
#

Are you using a venv? I think if a venv got made before installing that system package, it may need to be recreated instead for the tkinter to be linked properly in it

mellow ledge
#

Also if you installed a new version of python recently your directories could be messed up, had this issue about a week ago as well

desert carbon
#

Im also using 3.11 btw

modern yacht
# desert carbon Im also using 3.11 btw

You gotta manually change the settings in the IDE - it probably sees it being different from what was before, or even at different location, so it shows the old one is invalid.

As for the second thing:
The fedora package with Tkinter was for 3.12.
Try something like python3. 11-tkinter to get it for 3.11. Might be a bit different name for dnf, but apt uses that kind of naming - python3-whatever is for system version python (the one that gets preinstalled and some system stuff use it), while other python versions require minor version in the package name

jagged geode
cinder basaltBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.