trapgrave
trapgrave

Reputation: 19

AttributeError: module 'customtkinter' has no attribute 'CTkFont', i imported customtkinter?

Does someone know, why I get this error? I imported customtkinter the correct way and already redownloaded it, do i have to import it seperately? I import customtkinter and get this error:

AttributeError: module 'customtkinter' has no attribute 'CTkFont'

when executing this piece of code:

label1 = customtkinter.CTkLabel(master=frame, text="WUA", font=customtkinter.CTkFont(family="Verdana", size=45)) label1.pack(pady = 20, padx=20)

Upvotes: 1

Views: 3290

Answers (3)

Bamise Oluwayinka
Bamise Oluwayinka

Reputation: 1

Well i just use the font keyword directly on the customtkinter widget. For example:

import customtkinter as ctk

window = ctk.CTk()

label = ctk.CTkLabel(window, text="My Label", font=("Cosmic Sans MS",20))

label.pack()

window.mainloop()

Upvotes: 0

Faizan Munsaf
Faizan Munsaf

Reputation: 1

font= customtkinter.CTkFont(weight="bold",size=45)

use this

and read this doc may it help you

Upvotes: 0

JRiggles
JRiggles

Reputation: 6780

I think I found the problem...it says at the top of the utility wiki page: "Widget will be available with version 5.0.0!" - the current version is 4.6.3

Upvotes: 5

Related Questions