stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[FEATURE REQUEST] Add a check for python version
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What would your feature do ?
Just check that python version is 3.10, and not other
Proposed workflow
- Get python version
- Compare it to 3.10
- If it is mismatched, say user that he installed wrong python version and needed is 3.10.
Additional information
i am tired to say people they need exactly 3.10 and not 3.11 or 3.9 or any other
Sadly, it might be useful, but also pretty redundant. Anyone using this tech should at the very least be capable of reading the directions and checking out the troubleshooting section of the Wiki before posting a bug report.
Actually, the Web UI will run in Python 3.9 with some modifications, and you are actually told that some features are not supported.
But I disagree, @skdursh - many people who log issues here have no idea what they're doing.
Yea actually it's probably not a bad idea.
So many tech support posts / bug report issues are due to using a wrong version.
I guess nobody will implement this, right?
According to README.md
users should only do the following for an Automatic Installation on Linux
:
- Install dependencies (it doesn't say anything about requiring python 3.10.6 -that's only mentioned in another page called Dependencies)
- Run
webui.sh
script
Unless you modify it, the webui.sh
script will run using the default python version of the linux system (eg. in Debian 11 that would be Python 3.9)
Perhaps the script should be a bit flexible.
- it doesn't say anything about requiring python 3.10.6 -that's only mentioned in another page called Dependencies
I think it is pretty obvious why it says python version only in Dependecies
page, isn't it? (cuz it is dependecity)
@Spaceginner
True. But the main page says:
Automatic Installation on Linux
- Install the dependencies:
Debian-based: sudo apt install wget git python3 python3-venv Red Hat-based: sudo dnf install wget git python3 Arch-based: sudo pacman -S wget git python3
It suggests, for linux users, all dependencies are installed in one command line. But if you apt install python3
from the latest Debian release, it will install Python 3.9.
The main page is not clear about which Python version to use when following the linux instructions paragraph.
Correct me if I'm wrong, as far as I know 3.9/3.10/3.11 all work on Linux.
The problem is mainly on Windows. Namely there isn't a torch wheel for 3.11.
@wywywywy
I've encountered problems with Python 3.9 using Linux especially torch related.
Just curious, what are the problems? Is it xformers?
@wywywywy
I've read xformers causes a lot of headaches so I haven't even look at it (also, I have 20MB of GPU RAM so it seems it is needed when having less memory than that). I just haven't been able to train using Dreambooth extension. :/
on that topic i can say this is a REALLY bad idea, like OS breaking levels of bad... an incident today made me get an account right now after encountering a mishap just to respond to this. count this as a kind of bug report if you will...
when you change the main version of Python on Linux, the OS break in all kinds of ways, i have Linux Mint 20, it came with Python 3.8.10 (the webui works fine right out of the box, only xformers needs 3.10) and i made the mistake of installing Python 3.10 and making it the default...
that alone made the PC unable to use the mouse cursor, the keyboard and desktop (was all black) my only luck was that Ctrl+Alt+T still worked, i got lucky to have the old commands in the list and luck out in my intuition on how to set Python 3.8 back to default navigating old commands with the up key and modifying them...
now even worst in my case, i followed a tutorial, a really dumb one, i am dumber for following it when it lead to a "Yes do as I say!" and typing it, this on top deleted quite a few packages, the only ones i know for sure was the update manager and software manager, the welcome screen and Firefox... i guess Python 3.8 is absolutely embedded in the system since that command was only uninstalling Python 3.8... i lucked out that synaptic package manager was still installed...
Anyhow, i suggest instead a good tutorial on this Github to make use of multiple installs of of Python, i see you can point to multiple installs on windows editing the .bat but there is nothing for the .sh linux side of things or how to set some venv... i have both versions of python installed plus 3.9 but no way to tell the webui.sh to use a specific one. (the ones defined with "sudo update-alternatives --config python3" i can switch them but when i restart and 3.8 is not the default, the OS breaks.)
sorry for the long post but i got lucky in those 4 hours of panic thinking my OS was done, a simple way to install other Python versions and a way to point to them from Linux and windows would help a lot more being on this Github than blocking working versions such as 3.8 that only lacks minor features. (and if full dependency go 3.10 then the tutorial is already made and local.)
on that topic i can say this is a REALLY bad idea, like OS breaking levels of bad... an incident today made me get an account right now after encountering a mishap just to respond to this. count this as a kind of bug report if you will...
when you change the main version of Python on Linux, the OS break in all kinds of ways, i have Linux Mint 20, it came with Python 3.8.10 (the webui works fine right out of the box, only xformers needs 3.10) and i made the mistake of installing Python 3.10 and making it the default...
that alone made the PC unable to use the mouse cursor, the keyboard and desktop (was all black) my only luck was that Ctrl+Alt+T still worked, i got lucky to have the old commands in the list and luck out in my intuition on how to set Python 3.8 back to default navigating old commands with the up key and modifying them...
now even worst in my case, i followed a tutorial, a really dumb one, i am dumber for following it when it lead to a "Yes do as I say!" and typing it, this on top deleted quite a few packages, the only ones i know for sure was the update manager and software manager, the welcome screen and Firefox... i guess Python 3.8 is absolutely embedded in the system since that command was only uninstalling Python 3.8... i lucked out that synaptic package manager was still installed...
Anyhow, i suggest instead a good tutorial on this Github to make use of multiple installs of of Python, i see you can point to multiple installs on windows editing the .bat but there is nothing for the .sh linux side of things or how to set some venv... i have both versions of python installed plus 3.9 but no way to tell the webui.sh to use a specific one. (the ones defined with "sudo update-alternatives --config python3" i can switch them but when i restart and 3.8 is not the default, the OS breaks.)
sorry for the long post but i got lucky in those 4 hours of panic thinking my OS was done, a simple way to install other Python versions and a way to point to them from Linux and windows would help a lot more being on this Github than blocking working versions such as 3.8 that only lacks minor features. (and if full dependency go 3.10 then the tutorial is already made and local.)
did you know that you could replace python
(or python3
) in webui.sh
with python3.10
so it will use Python 3.10?
Also it OS should have given you a warning, that by uninstalling python 3.8 it would also uninstall system packages.
and i forgot to close this issue, since it is already implemented
well i did not know when i wrote this but i actually tried this before reading this and even if i modify: python_cmd="python3" to python_cmd="python3.10"
when i run it, it still tries to start with 3.8.
does not matter if it is the webui-user.sh or webui.sh.
i was running 3.8 totally fine but wanted to try xformers and that is why i installed 3.10 and uninstalled.reinstalled 3.8...
i got it to run, i only noticed the broken OS on restarting the PC...
my current work around is to switch the default python with the "sudo update-alternatives --config python3" command for starting the webui.sh and then in an other terminal switch it back right away when it finished loading to make sure i do no t forget...
ironically when i put python --version, python3.10 --version i get 3.10.10 but if i put python3 --version i get 3.8.10 and that makes it weird that the webui.sh modded with python_cmd="python3.10" still gives:
################################################################ Launching launch.py... ################################################################ Python 3.8.10 (default, Nov 14 2022, 12:59:47) ...
, i only noticed the broken OS on restarting the PC...
is there such a thing as a PATH variable in linux? why not to try modifying it in webui.sh
so it will point to python 3.10 instead of 3.8?
, i only noticed the broken OS on restarting the PC...
is there such a thing as a PATH variable in linux? why not to try modifying it in
webui.sh
so it will point to python 3.10 instead of 3.8?
Yes, there is. If you are unaware of this, you really shouldn't begin your Linux life with Stable Diffusion. Your suggested way is not at all how you do this in Linux.
What you do is edit the symbolic link for python3 to refer to the Python location that holds Python 3.10, if your OS didn't so by itself. I personally fail to see the reason to have both 3.8 and 3.10 installed, as most software won't ever care if you use one or the other.
ln -sfn /path-to-python-3.10 /usr/bin/python3
The above will force your python3 link to point to /path-to-python-3.10
In Debian-based Linux variants, you can also use the tool update-alternatives to define various versions of the same application.
(BTW, there is a Linux-friendly way to do this without update-alternatives. You can refer to python3.10 in line 38 of webui.sh:
# python3 executable
if [[ -z "${python_cmd}" ]]
then
# the below was originally: python3
python_cmd="python3.10"
fi
If that does not work (as someone mentioned above), it is because the symbolic links made by your operating system are incorrect, and you will have to manually modify them using the ln command as described above.
in this example, i need to ask, if my links are messed up, would putting "python3.10 --version" display "Python 3.10.10"? and would it make "python3 --version" display "Python 3.8.10" or "Python 3.10.10"? i am asking since if i change the default python3 to anything else than "Python 3.8.10", that breaks the OS (Linux Mint 20)...
the odd thing is when i mod the webui.sh with: python_cmd="python3.10" it loads from 3.8 anyways and "python3.10 --version" display "Python 3.10.10" so does that mean that "python3.10" is not a symbolic link? (i hate being in the middle ground for understanding this OS, tech savvy enough to break it because i only understand half or surface level...)
anyhow i think i found a better solution to my problem with "pyenv" on a tutorial for Linux Mint that i also use: "[Tutorial] Safely install and use other Python versions for coding (Mint 20 and 21, 64-bit)"
the core problem is the OS needs to see "python3" as "python3.8.10" otherwise stuff breaks, especially the desktop (i think it was gnome that actually breaks.) so my hesitance on changing a dynamic link without understanding RIGHT after me breaking things in a similar fashion is what that makes me ask the questions... if it is fine and Linux Mint still uses 3.8 system wide unless specifically asked for 3.10, that is that i need. (as long as the programs can specify i guess...)
for the sake of completion i found the problem why the webui.sh was not loading 3.10 when i put it in the file, it's venv python3.10 file is a link of 5.5mb that leads to python3 in the same folder that then links to another python3 link that goes to the alternate installs where the real python installations are and "sudo update-alternatives --config python3" changes where that link points to, so 3.8 or 3.10 if i change it with that command... the real issue is that the venv was not directly pointing to python3.10 so i deleted the venv folder to make it rebuild it in hopes it links it right this time and it did... here is the error that made my intuition spike, the fact it is reading the version 3.8 while trying to load 3.10...
################################################################
Launching launch.py...
################################################################
Python 3.8.10 (default, Nov 14 2022, 12:59:47)
[GCC 9.4.0]
Commit hash: 3715ece0adce7bf7c5e9c5ab3710b2fdc3848f39
Installing torch and torchvision
/home/epicslayer-oe/stable-diffusion-webui/venv/bin/python3.10: No module named pip
Traceback (most recent call last):
File "launch.py", line 360, in
the bottom lines is trying to run some link of sorts but it is pointing to the wrong thing and i can't edit where it points so i deleted the folder to let the webui.sh rebuild it. since i had switched the 3.8 to 3.10 as system default, the venv was pointing to the system default even through python3.10 instead of the actual python3.10 location. tho i am still bad at computers...