Open anrunt opened 1 year ago
What's the version your using?
Im using 5.2.0 customtkinter version
So i thing ctk has some problem with ttkbootstrap, when i type import ttkbootstrap it instantly gives me that error no matter what im doing
@anrunt - If you're unable to import ttkbootstrap
, that is not an issue with customtkinter
. They are completely unrelated. Perhaps check you have installed ttkbootstrap
?
Looking at the error message, perhaps this is an error with ttkbootstrap
?
@dishb well, for now I'm not able to check it but im pretty sure that i have installed ttkbootstrap because i can import it in other project without any problems. I will check it when I will be back home from vacation 🙂
@anrunt - Weird, but still, if you're getting an ImportError
or something related in the line of code where you have the import
statement, that isn't due to CustomTkinter. import
statements are native to Python, and ImportErrors
are only raised by Python.
@dishb oh okay, thank you so much for explanation 🫡
So I'm doing weather app using open weather api and when I'm trying to use ctk widgets it's giving me this error.
My code: `import requests import tkinter as tk from tkinter import ttk import math from tkinter import messagebox from PIL import Image, ImageTk import ttkbootstrap import customtkinter as ctk
def get_weather(city): API_KEY = '862957c16730a84ba992b581fadd84e4' BASE_URL = f"https://api.openweathermap.org/data/2.5/weather?q={city}&appid={API_KEY}"
def search(): city = entry.get() result = get_weather(city)
main
window = ttkbootstrap.Window(themename="vapor") window.geometry('800x600') window.title('Cloudly')
Entry
entry = tk.Entry(window, font=('Arial', 22)) entry.pack(pady=5)
Button
search_button = ttk.Button(window, text='Search', command=search) search_button.pack(pady=5)
city_name_label = tk.Label(window, text="", font=('Arial', 20)) city_name_label.pack(pady=10)
temperature_label = tk.Label(window, text="", font=('Arial', 20)) temperature_label.pack(pady=10)
icon_label = tk.Label(window) icon_label.pack(pady=10)
appearance_label = tk.Label(window, text="", font=('Arial', 20)) appearance_label.pack(pady=10)
run
window.mainloop()
`