ModuleNotFoundError: No module named 'customtkinter' in macOS Sonoma #2267
Replies: 3 comments
-
@cyber-titan You are using the python where customtkinter is not installed (probably python 2 that comes by default in mac). use |
Beta Was this translation helpful? Give feedback.
-
@Akascape I don't have Python 2 and the other thing is I am using my venv which I activated and has the customtkinter module. I am not using the wrong interpreter or not like the module is not installed or I have not activated my virtual environment. |
Beta Was this translation helpful? Give feedback.
-
After you activate your venv, have you double checked your Python version?
Also, does your command prompt change accordingly? |
Beta Was this translation helpful? Give feedback.
-
Description:
I have correctly installed the module into my virtual environment as I verified it by using "pip list" when the virtual environment was activated. But when I run a simple code for GUI it is saying ModuleNotFoundError: No module named 'customtkinter'
Code:
import customtkinter
def button_callback():
print("button pressed")
app = customtkinter.CTk()
app.title("my app")
app.geometry("400x150")
button = customtkinter.CTkButton(app, text="my button", command=button_callback)
button.grid(row=0, column=0, padx=20, pady=20)
app.mainloop()
System Info:
OS: Macbook M2 Sonoma 14.2.1
Python version: Python 3.9.6
I am using a virtual environment which has the following packages
Package Version
customtkinter 5.2.2
darkdetect 0.8.0
numpy 1.26.3
packaging 23.2
phe 1.5.0
pip 24.0
Pyfhel 3.4.2
setuptools 58.0.4
tk 0.1.0
Beta Was this translation helpful? Give feedback.
All reactions