Hey, guys. I’m not sure exactly which support tab I should have put this under, but I use Gnome, so I thought I’d start here.
The short, I’m trying to use Kohya (which has do do with Standard Diffusion AI art) but it demands Python 3.9 or 3.10. I tried using pyenv (which I’ve never used before) to install and shim (or whatever?) 3.10.x onto the computer. I attempted to use it global, and local in the Kohya folder, but Kohya kept crying that I had too high of a version (3.11.3, I believe). So, I went to pacman and tried to remove it, but I just couldn’t get the dependencies take care of, so I did a silly thing and ran sudo pacman -Rcns python and just kinda blitzed through it. The idea being that I’d just try to get 3.10 or 3.9 installed and assess the damage afterwards.
Boy. There was a lot of damage. The computer still runs technically fine, but I don’t even have pacman anymore!
So, I’m backing up my files and reinstalling Manjaro Gnome edition now.
The problem still remains. From a fresh install, I need to get 3.9.x or 3.10.x running either as the standard or somehow get pyenv to effectively trick kohya into using it. I know that’s not in the scope of this, though (unless you just happen to know how to do it and wish to contribute it).
My first aim is to try to get Manjaro Gnome running with 3.10.x or 3.9.x without utterly breaking everything. I’m also okay if there’s a solution to somehow have it and 3.11.x running simultaneously so that everything can work fine.
I’m also not very terminal savvy (as you can clearly see from the damage I did), so don’t be afraid to talk to me as if I’m ill informed. Because I am. Hahaha. Reinstalling Majaro now. Any help is greatly appreciated. <3 Thank you in advance.
You found pyenv, which is perfect:
pyenv install 3.10.13
pyenv local 3.10.13
Thanks, mithrial. Unfortunately that’s precisely what I did, but when I ran the setup.sh, it still kept giving me “Error” in red and stating that the 3.11.3 was incompatible.
Specifically, just in a generic terminal tab, I installed 3.10.11 in the same fashion as you.
I then physically went to the drive that kohya is installed on and opened the kohya folder, I right clicked in an empty spot and typed in the same local command that you have there, and I was still getting the error.
Idk if I somehow installed pyenv incorrectly? If that’s even possible, or if I needed to delete everything in the kohya folder and start over again after the first time it warned me? (Like, idk if there’s some lingering effect from it being incorrect when I first tried). I’m just not sure where the issue happened, but yeah. I know it’s beside the point.
The point you’re making is that I was correct to use pyenv and that it is still the best option?
I don’t know what a “mouse” is
If you don’t tell what the error is, there’s nothing to go on.
Use the commands I gave you, and it should use the installed python version.
Haha, yeah, no, I totally get that. I’m just in the middle of the reinstall process and don’t have it available at this second. I’ll try to get something up in about an hourish. Sorry if I came across wrong.
The version of Python you suggested, it says it doesn’t exist, so I used x.x.11 instead. It said I lacked tk, which I did end up installing using sudo pacman --noconfirm -S tk
I tried to change the version in the folder, never got any confirm or anything, so I assume it worked. Then I ran the .sh file, and the error shows here.
How did you install pyenv? It seems, that it doesn’t update the path.
Try this and restart your shell.
echo 'eval "$(pyenv init -)"' >> ~/.zshrc
I typed the command as you said in a new terminal. Didn’t “say” anything after, so I’m not sure what it was supposed to do or if I was supposed to give you anything after that. I restarted my computer, and opened a terminal in the koyha folder again, changed my local version the same way (no response again), and the problem still persisted when I ran the .sh.
As far as installing it, I opened the pacman and installed it there.
“Official Repository (extra)”
In the future never ever try to force “alternative” versions of python, perl, gcc or whatever on the root system. And don’t use the cascading flag. This is a rolling release and there is 1 system version of everything - the newest. That is the whole point of arch.
Pyenv, venv and pipx are the tools for the job in your case. Just see what was wrong with it.
Thank you for the reply, Teo. I’m very much so one of those Linux converts that’s not in a tech/programming field (Linux is sometimes a bit too advanced for me). But I have been using it for several years at this point and I’m so grateful that Linux has gotten to such a point where I’m even capable of using it! I’m happy to see how it’s becoming more and more inclusive.
That said…I def still do some silly stuff ahaha. I appreciate your guidance.
Yes, you installed pyenv correctly, but it looks like it doesn’t set the PATH correctly. (How would it, it’s a user choice not a global choice.)
The snippet above will load pyenv in every terminal you open (if it’s zsh, but I think it is) and set the PATH and shims correctly.
Then, you should be able to run
pyenv local 3.10.12 (or whatever 3.10.x version you want), which then will give the result:
$ python -V
If you do this inside the cloned repo’s directory, pyenv will remember the python version you set.
Hey, @mithrial . Are you suggesting that the path I’m setting in terminal to the kohya folder is incorrect?
I’m opening the kohya folder, and right clicking inside the terminal and hitting “open in terminal” on the right click.
If that’s what you’re suggesting I’m doing wrong, would it have something to do with the fact that it’s on a mounted hard drive (not the same drive as my operating system…one I have to put a password in to mount).
Of course while I’m typing all of this, it is mounted because I’ve accessed it and I have the folder open.
I don’t know that that’s the issue, though. If you look at the top, I took your advice and checked the python version and it says that it’s 3.10.11 for the folder or whatever, but kohya is still detecting 3.11 for whatever reason.
I’m sorry if I’m misunderstanding your advice. I feel like I’m doing everything I know to and can to the best of my ability. That’s kinda what led me to try to forcibly remove 3.11, though I now know that was a bad idea ahhaha. Regardless, I appreciate you!
No, do not remove Python 3.11. That’s what brought you this mess in the first place.
I guess from your first attempt, the virtual environment does still exists. Can you clone the source again and try again?
The installation script is not very good. It screams in bold and red
error but then continues happily.
Sure enough you’re not wrong! haha. It seems something indeed was left behind from the “bad” install before because now that I deleted it all, recloned it, changed the local python again, and ran the setup.sh, it seems the python issue has indeed been resolved! What a relief!
You’ve been of immense help and I really appreciate your time and knowledge!
Now off to figure out what this “could not automatically configure accelerate” issue is.
Because you don’t have a compatible GPU, I guess.
But that’s out of this scope, you should ask upstream at the repo’s issue page.
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.