StabilityMatrix icon indicating copy to clipboard operation
StabilityMatrix copied to clipboard

OneTrainer AttributeError: module tkinter - and FluxGym Error

Open technerd-official opened this issue 11 months ago • 3 comments

Package

OneTrainer and FluxGym

When did the issue occur?

Installing the Package

What GPU / hardware type are you using?

Nvidia 3090

What happened?

OneTrainer does not launch. My system is Linux ZorinOS 17. Errors below

Can I fix it myself somehow? Any clues?

PS. FluxGym also not working. It launches fine but when I want to start training: "train.sh: line 1: accelerate: command not found"

Console output

/home/joshua/Downloads/Data/Packages/OneTrainer/venv/lib/python3.10/site-packages/_distutils_hack/init.py:53: UserWarning: Reliance on distutils from stdlib is deprecated. Users must rely on setuptools to provide the distutils module. Avoid importing distutils or import setuptools first, and avoid setting SETUPTOOLS_USE_DISTUTILS=stdlib. Register concerns at https://github.com/pypa/setuptools/issues/new?template=distutils-deprecation.yml warnings.warn( AttributeError: module '_tkinter' has no attribute 'file'. Did you mean: 'name'?

The above exception was the direct cause of the following exception:

ImportError: failed to load tkinter functions

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/home/joshua/Downloads/Data/Packages/OneTrainer/scripts/train_ui.py", line 5, in from modules.ui.TrainUI import TrainUI File "/home/joshua/Downloads/Data/Packages/OneTrainer/modules/ui/TrainUI.py", line 22, in from modules.ui.TrainingTab import TrainingTab File "/home/joshua/Downloads/Data/Packages/OneTrainer/modules/ui/TrainingTab.py", line 4, in from modules.ui.TimestepDistributionWindow import TimestepDistributionWindow File "/home/joshua/Downloads/Data/Packages/OneTrainer/modules/ui/TimestepDistributionWindow.py", line 13, in from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg File "/home/joshua/Downloads/Data/Packages/OneTrainer/venv/lib/python3.10/site-packages/matplotlib/backends/backend_tkagg.py", line 1, in from . import _backend_tk File "/home/joshua/Downloads/Data/Packages/OneTrainer/venv/lib/python3.10/site-packages/matplotlib/backends/_backend_tk.py", line 25, in from . import _tkagg ImportError: initialization failed

Version

v2.13.2

What Operating System are you using?

Linux

technerd-official avatar Jan 28 '25 01:01 technerd-official

having the same issue here but for onetrainer

fedora linux 41 (KDE) radeon 7900 xtx

a dirty workaround is to delete the venv folder and remake it with python3.10 -m venv venv while in this directory (you have to install python3.10 for that to work) then source venv/bin/activate and finally pip install -r requirements.txt --force-reinstall (radeon users must open the requirements.txt and change the first line from"requirements-cuda.txt" to "requirements-rocm.txt" ) this lets the app launch but i dont know if theirs any side effects to this as im still trying to learn how to use this app

XDM-Inc avatar Feb 01 '25 08:02 XDM-Inc

I'm having exactly the same problem. The output when I try to load OneTrainer is identical, word for word. I'm on Linux Mint 22, Cinnamon Edition, and my GPU is a 4070 ti super. I've currently got Python 3.12.3, CUDA 12.8.61, and CuDNN 9.7.1 installed. Nvidia driver is 570.86.10

I just switched to Linux this month, (lifelong Windows user until recently) and not exactly computer literate, so that's about all I can tell you. I hope this post is okay. I read the contributing guidelines, but I honestly have no idea what any of that means. My only experience with computer programming is the C++ class I failed in college over a decade ago.

GloomyGazer avatar Feb 16 '25 08:02 GloomyGazer

For anyone else having this issue, take a look at this section: Installing the required Python version for OneTrainer over on the OneTrainer github. A 10 min pyenv install could save you hours of frustration.

del3125 avatar Jul 22 '25 04:07 del3125