1
ValueError: ['text_font'] are not supported arguments. Look at the documentation for supported arguments.

the following error is showing when I try to run my customtkinter GUI on visual studio for python.

I'm using windows 11.

2
  • 1
    Please edit your question and include the code you are running which has this error. Right now, with no code and not even an indication of which packages you are using that might generate that error, there's simply no way to help you. Dec 2, 2022 at 21:41
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
    – Community Bot
    Dec 3, 2022 at 19:33

3 Answers 3

3

I was updating a old gui so I went to customtkinter. I got the same error. The docs indeed say text_font=("abc", 12). But when you look into the module, there is the argument "font", use this instead:

self.label = customtkinter.CTkLabel(master=self.frame, text="your_text", font=("Roboto", 24))
2
Traceback (most recent call last):  File "C:\Users\user\PycharmProjects\pythonProject1\main.py", line 18, in <module>
label = customtkinter.CTkLabel(master=frame, text="Login System", text_font="Roboto")  File "C:\Users\user\PycharmProjects\pythonProject1\venv\lib\site-packages\customtkinter\windows\widgets\ctk_label.py", line 90, in __init__
check_kwargs_empty(kwargs, raise_error=True)  File "C:\Users\user\PycharmProjects\pythonProject1\venv\lib\site-packages\customtkinter\windows\widgets\utility\utility_functions.py", line 18, in check_kwargs_empty raise ValueError(f"{list(kwargs_dict.keys())} are not supported arguments. Look at the documentation for supported arguments.")ValueError: ['text_font'] are not supported arguments. Look at the documentation for supported arguments.

Instead of using text_font=("Roboto"), 24)). Use (master=frame, text="Login" font=("Roboto"), 24)). The current version library to 'customtkinter' update may have caused the change.

0

I have some more explanation to the problem, for user sara Alqahtani>> because I face the same error with no luck to a solution.. hopefully someone will figure it out.

I recently upgraded customtkinter to the newest version something like 5.0 and I use pyinstaller to pack python script file to an executable exe file using the code of :

pyinstaller --noconfirm --onedir --windowed --add-data "c:\users\pcc\appdata\local\programs\python\python310\lib\site-packages/customtkinter;customtkinter/"  "main.py"

this code, I mean exe file, works fine when before upgrade customtkinter, I was using version of something like customtkinter 4.0

so after upgrade this error throws:

 Failed to execute script "main" due to unhandled exception: ['text_font'] are not supported arguments. Look at the documentation for supported arguments

Traceback (most recent call last):
  File "main.py", line 1161, in <module>
  File "main.py", line 101, in __init__
  File "customtkinter\windows\widgets\ctk_label.py", line 90, in __init__
    check_kwargs_empty(kwargs, raise_error=True)
  File "customtkinter\windows\widgets\utility\utility_functions.py", line 18, in check_kwargs_empty
    raise ValueError(f"{list(kwargs_dict.keys())} are not supported arguments. Look at the documentation for supported arguments.")
ValueError: ['text_font'] are not supported arguments. Look at the documentation for supported arguments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.