-
Notifications
You must be signed in to change notification settings - Fork 26.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webui not working with Python 3.12 [Bug]: #15667
Comments
it is quite common to install multiple versions of python without extra tools like miniconda
I guess it depends on your distro, it's there on ubuntu also 3.10 is still within support https://devguide.python.org/versions/ I believe it's only not working on python3.12 is because we use pytorch 2.1.2, python3.12 only comes in later versions
personally think it's better to wait about a year until switching to the newest stable python version otherwise I think it's just looking for trouble |
For Arch users who will have trouble going back to a previous version like me and come here: If you try using pyenv to make SD use python 3.10.6 then it won't work (probably). I set the local python, global python and tried everything I can (within my limited knowledge) to make SD use 3.10. Even though python --version returned 3.10.6 running webui.sh started it with 3.12. What you want to do (if you use "pyenv install 3.10.6") is edit webui-user.sh and set the path manually. Uncomment the second line below and input the path to your 3.10.6 version. Your path should be similar to mine:
|
not on ubuntu 24.03. This is what you get when you try to install it: E: Couldn't find any package by glob 'python3.10-venv' |
or read my updated guide with building from source + swapping https://civitai.com/articles/1503 |
had to update cause I ran into this issue yesterday and been working on figuring out a fix |
Thank you, I didn't know that'd work. Edited according to your advice :) |
Okay, but the problem right now is that the new LTS version of Ubuntu comes bundled with 3.12 and has no straightforward way of allowing users to install 3.10 If making the webui work with 3.12 is a bad idea then the documentation needs to be updated to let Ubuntu 24.04 users know how to install it properly. |
no one is saying 3.12 is a bad idea 3.12 support should come when we update torch
upgrading torch on its own is a really big change if you wish to test new version of torch with to see if it works with python 3.12
remove the I think you also need the |
You could build from source like I mentioned, though you have to get dpkg and make before doing it, but its in my arch guide but you need to change pacman parts to apt |
thank you all for the feedback. but it feels like I am not getting my point across. but the problem is that those workarounds are not being documented anywhere that is easily accessible, and the existing documentation is misleading and not up to date. I mean, sure, we can hope that people stumble across this ticket when they run into this problem in the future... but I feel like updating the documentation would help a lot of people and stop other tickets like this one from being created. |
Here's how I fixed it:
|
like sure if you or anyone can provide a better simple set of instructions that we can update that would be nice
|
I had the same problem but thanks to @httpjamesm , I finally can run sd natively! (I've been running it on podman for a while.)
As @Mackain said, updating the documentation probably helps a lot of people because newer linux distros use python3.12 as the default. |
If the only issue is keeping python 3.10.6, I can provide a fix but you can still use latest, it just risks bugs here and there on linux distros being alot of packages depend on python |
I still don't really understand why installing a secondary version of python causes issues on Linux |
Its not installing a secondary version that is the problem, its swapping default, though now that you mention it, no issues on my end keeping 3.12 default so I'll check tomorrow and get back to you |
ya |
Yeah I made a PR with changes lmk what think |
The issue is that the version of python required seems to no longer be available trough apt/apt-get on Ubuntu 24.04. Or at least not trough the way described in the current documentation. I would be happy to help write that documentation, but I will not have access to my computer for about 24h so I will get back on that one |
Hey hi, but I wonder, hot to "Install version 3.10", if the issue that we cannot install it. |
Nothing simple about all that and your solution. I cannot do it with a precise step by step guide. I guess I will install previous Ubuntu version. |
Similar to what @httpjamesm suggested. To me is working fine (so far) with python 3.11 installed from deadsnakes ppa
And then just change the symlink at Also I upgraded all my A1111 plugins as I was getting another error because of one of them. |
Again, it works with any python version, just not all the functions will without it being 3.10.6, and the notification is mostly to get people on that version, if it prevents from starting, then it would be a issue, but you only need install 3.10.6 |
Not really sure but maybe trying to make the installation code with this https://pytorch.org/get-started/locally/ |
This is the fix. You are actually insanely huge. It actually says in the webui.sh file to edit the -user file and I just completely ignored it and stared dumbfounded as my shebangs to the pyenv environment didn't work. Never drop your crown king. |
for Archlinux: just install any AUR package manager(for me:yay) and install python310 package |
I switched to 3.10, but now I'm getting thi:
pip is installed EDIT: |
Hey guys. I'm having the same issue in Ubuntu 24.04. Would it be enough if I just replace the |
it is common practice to have multiple python version to install on the same system stable-diffusion-webui/webui-user.sh Lines 15 to 16 in feee37d
no need of nonsenses with symlinks |
My opinion: if you change Ubuntu 24.04 LTS default (systemwise, not virtual) to Python 3.10.4, your apt do not work. So, do not do ln -s python3.10 /usr/bin/python3 !! If you did, switch it back to ln -s python3.12 /usr/bin/python3. I installed python 3.10.4 from deadsnakes
... and then modified webui.sh at stable-diffusion-webui (as previous post explains): python_cmd="python3.10" So, python and python3 commands points to 3.12.3 and python3.10 command points to 3.10.4. Test it with python -V and python3.10 -V Perhaps Automatic1111 could work with Python 3.12 as ComfyUI does. Xformers was causing a little bit issues and that I fixed like this (Python 3.12 venv active (source venv/bin/activate)):
|
Thanks you so much for your detailed step by step instructions! It is clear for newbies (me) and understandable. |
seems to have been solved in #16178. with the documentation updated this issue now has a working workaround. |
Checklist
What happened?
When running webui.sh you get an error that complains about torch. my understanding is that this is caused by later versions of Python not being compatible.
When you download python3 today you get 3.12. this is also the version of python that comes bundled with most OS installers (including archinstall, but I guess that depends on the choices you make during the installation process)
And, yes. The dependencies page does clearly state that it does specifically require 3.10.6. but downgrading Python is easier said than done. Most people have other things on their machine that require a later version of python, so downgrading python system-wide can potentially be dangerous and ruin your OS.
(There are also instructions on the NVIDIA page that you should install python3.10-venv. but that package does not exist anymore it seems... and you just get the error: E: Couldn't find any package by glob 'python3.10-venv')
Most people will not know how to set up miniconda or other tools to handle multiple versions of Python, so this has become a barrier that stops most people from using the webui now.
If it is not possible update the webui so that it works with a later version of python, then at least there needs to be clear and understandable instructions either in the README or the Dependencies that explains how to get around this issue. This cannot be hidden somewhere in a closed issue or a discussion thread but needs to be available and visible.
when I google this issue it becomes clear to me that this is an issue that has persisted for a while and has also popped up in previous versions of Python. so it seems to me that it would save everyone a lot of time and energy if clear instructions where given on how to deal with it (if it cannot simply be solved by updating the dependency)
in other words: I do not know if it is possible to fix the dependency, but if not then there at the documentation needs to be updated.
Steps to reproduce the problem
What should have happened?
either webui should have just worked without the error OR clear instructions should have been given in the README on how to not end up in this situation.
What browsers do you use to access the UI ?
No response
Sysinfo
OS: Ubuntu 24.04 LTS x86_64
Kernel: 6.8.0-31-generic
Uptime: 9 mins
Packages: 1676 (dpkg), 10 (snap)
Shell: bash 5.2.21
Resolution: 2560x1080
DE: GNOME 46.0
WM: Mutter
WM Theme: Adwaita
Theme: Yaru-dark [GTK2/3]
Icons: Yaru [GTK2/3]
Terminal: gnome-terminal
CPU: Intel i9-9900K (16) @ 5.000GHz
GPU: NVIDIA GeForce RTX 2070 SUPER
Memory: 2210MiB / 48082MiB
(have also tried with arch running KDE on same machine)
Console logs
Additional information
No response
The text was updated successfully, but these errors were encountered: