AUTOMATIC1111 / stable-diffusion-webui

Stable Diffusion web UI
GNU Affero General Public License v3.0
138.12k stars 26.26k forks source link

[Bug]: calling `%PYTHON%` in webui.bat stops the execution of the rest of the script. #16139

Open RalkeyOfficial opened 1 month ago

RalkeyOfficial commented 1 month ago

Checklist

What happened?

The first line where %PYTHON% is called stops the execution of the rest of the script. This happens with any usage of %PYTHON%.

image

You can test this by putting echo before and after the %PYTHON% call

image

You can test this further by running PYTHON --version and doing the same test

image

Steps to reproduce the problem

  1. Install Python 3.10.6 via pyenv-win.
  2. Get the latest version of webui, latest is commit feee37d on master branch.
  3. Set version 3.10.6 as the local version (pyenv local 3.10.6).
  4. Try to launch webui
  5. (optional) run the tests I did above.

What should have happened?

WebUI should have launched as expected.

What browsers do you use to access the UI ?

Google Chrome

Sysinfo

not available

Console logs

none

Additional information

Python 3.10.6 is installed via pyenv-win.

brackson commented 1 month ago

Had this experience too. I solved it by installing 3.10.6 through pyenv, creating a venv folder in the base of stable-diffusion-webui, activating it, then running webui.bat. There's definitely a cleaner way to do this.

Using Windows 11 Pro, pyenv==3.1.1

E:\AI_Stuff\stable-diffusion-webui> pyenv install 3.10.6
...
E:\AI_Stuff\stable-diffusion-webui> pyenv local 3.10.6
E:\AI_Stuff\stable-diffusion-webui> python -m venv venv
E:\AI_Stuff\stable-diffusion-webui> venv\Scripts\activate.bat
(venv) E:\AI_Stuff\stable-diffusion-webui> webui.bat
venv "E:\AI_Stuff\stable-diffusion-webui\venv\Scripts\Python.exe"
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.9.4
Commit hash: feee37d75f1b168768014e4634dcb156ee649c05
...