kohya_ss icon indicating copy to clipboard operation
kohya_ss copied to clipboard

Avoidable confusion about the Python version

Open madrooky opened this issue 11 months ago • 2 comments

I believe I finally have solved the nasty version issue I always had with Kohya. The thing is, I also need Python 311 and 312 for other applications. And since handling different versions is new to me, i did not know how to handle this correctly. In the end Kohya never really worked to 100% because it always wanted to use the latest Python version. And the reason is that in the setup instructions there is no word to change the "python" command to the full path, in case multiple versions are installed. So I ran Kohya mostly on the wrong Python version 312 without really noticing, training works, but when I tried to use git captioning for example I ran into errors, because the wrong python version also caused a pip error and so not all modules are installed correctly.

So, long story short, i would suggest that right after the instruction to select the option to add Python to the 'PATH' environment variable, there needs to be the instruction to change the setup.bat accordingly once it is downloaded. A user who does not use Python regularly will have problems to figure that out, and I have seen so many comments of people who struggle with this.

Another way could be to build the check for the correct path into the script directly. "where python" returns the path of installed versions, and that can be used to set the path automatically. That's just an idea, there might be a more elegant way to do that.

madrooky avatar Feb 25 '24 13:02 madrooky

I run these in conda environments specifically so I can run them using whatever python version they require. Getting a system level version of python that works for everything is essentially impossible.

Kadah avatar Mar 12 '24 12:03 Kadah

The current scripts assume that the right version of python is being used. If someone want to create a PR that address the many python install option I will gladly take it. But... updating the setup.bat or gui.bat (or any other git tracked files) at the user end is probably going to cause issues down the road when a new version that modify those files is published... so that is not the right solution for sure...

Striking the right balance between simplicity and flexibility is hard.

bmaltais avatar Mar 12 '24 18:03 bmaltais