How do I install CustomTkinter and fix No module named 'customtkinter'?
CustomTkinter is a Python package on PyPI, so there is no installer or .exe to download. Install it with pip, through the same Python you run your script with. That second half is what fixes nearly every ModuleNotFoundError afterwards:
python -m pip install customtkinter # macOS, Linux
py -m pip install customtkinter # Windows
# Check it worked, with the same python:
python -c "import customtkinter; print(customtkinter.__version__)" Installed it, still 'No module named customtkinter'
Then pip installed it into a different Python from the one running your script. A machine often has several: the system one, one from python.org, Homebrew, Anaconda, the Microsoft Store, and every virtual environment. Plain pip is whichever came first on your PATH, which is why python -m pip is the reliable form. It installs into exactly the interpreter that python starts.
To see which Python is running your code, print sys.executable from the script itself, then install with that path. In VS Code the interpreter is chosen per workspace and is the usual culprit, which is its own page.
import sys
print(sys.executable)
# then, in a terminal:
# /that/exact/path -m pip install customtkintererror: externally-managed-environment
Recent Ubuntu, Debian and Fedora releases, and Homebrew on macOS, refuse pip install into the system Python so it cannot break the operating system's own tools. The fix is a virtual environment for your project, which is good practice anyway. Avoid --break-system-packages, which does exactly what it says.
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install customtkinter # inside the venv, plain pip is safeThe name: customtkinter, all one word
pip ignores case, so CustomTkinter installs the same package, but custom-tkinter and custom_tkinter find nothing. Be careful with pip install ctk: that name belongs to an unrelated package. ctk is only the short name people give CustomTkinter when they write import customtkinter as ctk.
The import is always lowercase: import customtkinter. A capitalised import CustomTkinter fails even when the package is installed.
Is CustomTkinter safe and free?
Yes. It is written by Tom Schimansky, published on PyPI and GitHub under the MIT licence, and free for commercial use too. It is pure Python, so nothing gets compiled, and it pulls in two small dependencies, darkdetect and packaging. The risk is downloading a copy from some other site, so install it from PyPI with pip and nothing else.
Installing without internet (school and lab machines)
Download the package and its two dependencies on a machine that is online, copy the folder across on a USB stick, then install from the folder. Both machines need the same major Python version.
# Online machine
python -m pip download customtkinter -d ctk-wheels
# Offline machine, with the ctk-wheels folder copied over
python -m pip install --no-index --find-links ctk-wheels customtkinterWhen the error is about tkinter, not customtkinter
CustomTkinter is built on tkinter, so it cannot import without it. If the traceback ends in No module named 'tkinter' or No module named '_tkinter', CustomTkinter is installed fine and Python's own Tk support is missing. On Linux that is usually the separate python3-tk package. Reinstalling CustomTkinter will not help.
Images are the other common surprise. CTkImage needs Pillow, and without it fails with ImportError: PIL.Image and PIL.ImageTk couldn't be imported. Fix it with python -m pip install pillow.
ttkbootstrap: No module named 'ttkbootstrap.scrolled'
ttkbootstrap is installed the same way, with python -m pip install ttkbootstrap. Version 2.0 removed the old ttkbootstrap.scrolled, ttkbootstrap.tableview and ttkbootstrap.toast modules, which 1.x had already marked as deprecated, so code from older tutorials fails on import. Import from ttkbootstrap.widgets instead. That path works on 1.20 and on every 2.x release, so it is safe whichever version a classmate has.
Old argument names like autohide=True still run on 2.x, with a deprecation warning pointing at the new spelling (auto_hide). If you need an old project running unchanged, pip install "ttkbootstrap<2" pins the last 1.x.
# Fails on ttkbootstrap 2.x:
# from ttkbootstrap.scrolled import ScrolledFrame, ScrolledText
# Works on 1.20 and 2.x:
from ttkbootstrap.widgets.scrolled import ScrolledFrame, ScrolledText
from ttkbootstrap.widgets.tableview import Tableview Doing it without the lookup
You do not need CustomTkinter installed to design with it. The designer runs in the browser, and switching the project to CustomTkinter changes the code it writes, which starts with the pip install customtkinter line as a reminder. Downloading the project as a zip adds a requirements.txt, so python -m pip install -r requirements.txt sets everything up in one go. The exported code runs on CustomTkinter 5.2 and 6.0.
Lay the window out visually and read the generated Python as you go.
Open the tkinter designer →