bmaltais / kohya_ss

Apache License 2.0
8.81k stars 1.15k forks source link

Kohya doesn't change version of Python #2443

Open srinoom opened 2 months ago

srinoom commented 2 months ago

at first, I had Python version 3.12 so when I installed kohya, it said this version it's Incompatible. then I removed Python 3.12 with Windows uninstaller and deleted PATH, then I installed Python 3.10.11 which recommended version, and when I checked by using Python --version it is 3.10.11 but when I reinstalled kohya again it's said No Python at '"C:\Users\\AppData\Local\Programs\Python\Python312\python.exe"

bmaltais commented 2 months ago

It is probably that the 1st version found in the path is still 10.12… because this is what the GUI scripts are seeing. I suspect you might need to fiddle with the path search order and make sure python 3.10.x comes 1st. This is really annoying and bugging me. I wish there was an easy way to specify the version but alas I have not found one that would work reliably.

bmaltais commented 2 months ago

@srinoom OK... I might have a solution... not sure if it will work for everyone on windows...

Before running setup.bat make sure to delete the existing venv folder. Then try to run:

py -3.10 -m venv venv

Then run setup.bat... does it work?

bmaltais commented 2 months ago

OK... I actually have implemented it in the dev branch... if you want to try it:

Delete the current venv folder then:

git fetch origin
git checkout dev
git pull
./setup-3.10.bat
daniel-farina commented 1 month ago

Using the python version manager works for me:

git clone https://github.com/pyenv-win/pyenv-win.git "$HOME/.pyenv"

Git bash, add the paths

nano ~/.bashrc
export PYENV="$HOME/.pyenv/pyenv-win"
export PATH="$PYENV/bin:$PYENV/shims:$PATH"
pyenv install 3.10.9
pyenv global 3.10.9
rm -rf venv
/.setup.bat