Repository navigation
OneTrainer fails to launch on Linux because Stability Matrix forces legacy CustomTkinter UI #1722
Description
Package
OneTrainer
When did the issue occur?
Running the Package
What GPU / hardware type are you using?
NVIDIA GeForce RTX 4090 with CUDA (driver 610.57.04)
What happened?
On Linux, launching a current OneTrainer checkout from Stability Matrix 2.16.2 exits immediately while constructing the legacy CustomTkinter UI.
Stability Matrix currently hardcodes scripts/train_ui_ctk.py in OneTrainer.cs. Current OneTrainer has restored scripts/train_ui.py as a compatibility shim that launches the new Qt UI, while train_ui_ctk.py is the legacy UI.
The Stability Matrix embedded Python 3.10.19 runtime reports Tcl/Tk 9.0.3. OneTrainer installs CustomTkinter 5.2.2. Creating the first CTkOptionMenu calls Menu.delete(0, "end"); with Tk 9 the empty menu index is returned as an empty string, causing tkinter.Menu.index() to raise _tkinter.TclError: expected integer but got "".
Steps to reproduce
- Install or update OneTrainer through Stability Matrix 2.16.2 on Linux.
- Use OneTrainer commit
23df3832e8f213d64c337e39f9365ba46e99fed0(currentmasterwhen reproduced). - Open Packages → OneTrainer.
- Press Launch.
Expected behavior
Stability Matrix launches OneTrainer's current supported/default Qt training UI.
Actual behavior
Stability Matrix launches scripts/train_ui_ctk.py, which crashes before a window opens.
Confirmed workaround
Changing the Stability Matrix-targeted entry point to delegate to train_ui_qt.main makes the exact formerly failing launch command open a mapped OneTrainer window successfully.
A durable package-side fix would be to launch scripts/train_ui.py when it exists. That file is explicitly maintained by OneTrainer as the compatibility shim for external launchers and currently delegates to Qt. If compatibility with the transitional revisions where that file was absent is required, scripts/train_ui_ctk.py could be used only as a fallback when scripts/train_ui.py does not exist.
Relevant current OneTrainer file:
# Kept for backwards compatibility with external launchers (e.g. Stability
# Matrix) that invoke this file directly instead of start-ui.bat/.sh.
from train_ui_qt import mainConsole output
nvCOMP: low-level batched-ANS backend loaded
Modular Diffusers is currently an experimental feature under active development. The API is subject to breaking changes in future releases.
Traceback (most recent call last):
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/scripts/train_ui_ctk.py", line 14, in <module>
main()
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/scripts/train_ui_ctk.py", line 9, in main
ui = CtkTrainUIView()
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/modules/ui/CtkTrainUIView.py", line 119, in __init__
self.top_bar_component = self.top_bar(self)
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/modules/ui/CtkTrainUIView.py", line 218, in top_bar
return CtkTopBarView(
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/modules/ui/CtkTopBarView.py", line 28, in __init__
self.build(frame, master, controller, ui_state, change_model_type_callback, change_training_method_callback, load_preset_callback)
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/modules/ui/BaseTopBarView.py", line 79, in build
self.components.options_kv(
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/modules/util/ui/ctk_components.py", line 484, in options_kv
component = ctk.CTkOptionMenu(master, values=keys, command=update_component)
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/venv/lib/python3.10/site-packages/customtkinter/windows/widgets/ctk_optionmenu.py", line 86, in __init__
self._dropdown_menu = DropdownMenu(master=self,
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/venv/lib/python3.10/site-packages/customtkinter/windows/widgets/core_widget_classes/dropdown_menu.py", line 44, in __init__
self._add_menu_commands()
File "/h-games/stabilitymatrix/Data/Packages/OneTrainer/venv/lib/python3.10/site-packages/customtkinter/windows/widgets/core_widget_classes/dropdown_menu.py", line 91, in _add_menu_commands
self.delete(0, "end")
File "/h-games/stabilitymatrix/Data/Assets/Python/cpython-3.10.19-linux-x86_64-gnu/lib/python3.10/tkinter/__init__.py", line 3381, in delete
num_index1, num_index2 = self.index(index1), self.index(index2)
File "/h-games/stabilitymatrix/Data/Assets/Python/cpython-3.10.19-linux-x86_64-gnu/lib/python3.10/tkinter/__init__.py", line 3406, in index
return self.tk.getint(i)
_tkinter.TclError: expected integer but got ""
Environment details:
Stability Matrix: 2.16.2+79b61f555667456e33bccfb25248e4bc3283aaca
OneTrainer: 23df3832e8f213d64c337e39f9365ba46e99fed0
OS: CachyOS Linux (Arch-based rolling release)
Python: 3.10.19 (Stability Matrix embedded runtime)
Tcl/Tk: 9.0.3
CustomTkinter: 5.2.2
Version
v2.16.2
What Operating System are you using?
Linux
Activity
NeuralFault commentedon Aug 24, 2026
OneTrainer install in SM on EndevourOS (Arch) was successful in building the tk UI, using Python 3.12 that is the installation default now in SM, just now.
Launching of the Tk UI directly was set since the dataset tools in the Tools tab are broken due to not being ported to Qt yet, which just confirmed is still the case. This can be reversed back to Qt, but it leaves the tool non-functional.
The failure happens when using Python 3.10 specifically for the install.
Reinstalling OneTrainer with python 3.11+ (or using the default 3.12) will resolve the UI launch failure.
SturmB commentedon Aug 28, 2026
Thanks — your Python-version diagnosis was correct for the original launch failure. I reinstalled OneTrainer under Python 3.12.12, and the Tk UI then opened successfully, including the Tools tab.
I subsequently tested the normal Tk workflow rather than retaining my Qt workaround. While using the concept-card/statistics workflow, OneTrainer crashed natively with
SIGSEGVbefore training started.Environment:
23df3832e8f213d64c337e39f9365ba46e99fed0The captured native stack was:
The relevant OneTrainer path runs the concept-statistics scan in a worker thread and reaches Tk through
widget.after(...). On this host, that resulted in a cross-thread Tk crash.So Python 3.12 does resolve the original Python 3.10
expected integer but got ""startup failure, but it exposed a separate later Tk stability problem during normal use. I restored my local adapter from Stability Matrix's selectedtrain_ui_ctk.pyentry point totrain_ui_qt.main; the Qt interface has remained stable for the training workflow, although I understand that its Tools tab is incomplete.This second crash appears to belong upstream in OneTrainer rather than Stability Matrix. If that assessment is correct, I can close this issue as resolved for the original launch failure and report the Tk cross-thread crash separately upstream.
github-actions commentedon Oct 28, 2026
This issue is stale because it has been open 60 days with no activity. Remove the stale label or comment, else this will be closed in 7 days.
SturmB commentedon Oct 28, 2026
The original Stability Matrix launch problem was resolved by reinstalling OneTrainer under Python 3.12. The remaining Tk cross-thread crash is a separate OneTrainer issue, so this issue can close. I will report the crash upstream with the existing reproduction evidence.