stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: The script for launching exit without an error

Open artegoser opened this issue 2 years ago • 4 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

I recently installed pyenv maybe it has something to do with it.

The webui startup script crashes without errors. image

The script ends after python -c ... image

When the virtual environment is activated the script works. image

Steps to reproduce the problem

  1. maybe install pyenv
  2. Go to folder with webui
  3. Press webui-user.bat

What should have happened?

The script should work on normal startup

Commit where the problem happens

5ab7f213bec2f816f9c5644becb32eb72c8ffb89

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

No response

Command Line Arguments

No

List of extensions

Doesn't matter

Console logs

They just don't exist.

Additional information

No response

artegoser avatar May 04 '23 09:05 artegoser

Is there something in those two tmp-files? image

AlUlkesh avatar May 04 '23 16:05 AlUlkesh

No

artegoser avatar May 04 '23 16:05 artegoser

What do you get when you enter python -VV without venv?

AlUlkesh avatar May 04 '23 17:05 AlUlkesh

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]

artegoser avatar May 06 '23 11:05 artegoser

I'm also running into the same issue. Removing pyenv's directory from user path seems to have resolved it, which essentially disables pyenv, which I don't really want to do since I use it to manage various python versions (duh).

But looking into more about how pyenv-win works, there's a directory shims that act as a proxy for other python So if you set your local folder environment to 3.10.6, the python in shims will point to pyenv's install of 3.10.6. But there seems to be some problem where this proxy fails.

The workaround this is to not go through the proxy, but instead just execute pyenv's install of 3.10.6 directly, by setting PYTHON in the webui-user.bat to where it's installed %USERPROFILE%\.pyenv\pyenv-win\versions\3.10.6\python.exe. This will allow pyenv to still be used on your system, and still let you use this version of stable diffusion.

uwidev avatar Jun 04 '23 16:06 uwidev

So I found something strange. Without pyenv, using the official python install, when I run python -c "", I get no output, no errors? But for pyenv, when I run that same command, I get the following:

> python -c ""
Argument expected for the -c option
usage: python [option] ... [-c cmd | -m mod | file | -] [arg] ...
Try `python -h' for more information.

It might be possible that the python compiled and downloaded on pyenv functions differently, but it certainly is strange.

Update - They are the same version, same commit 9c7b4bd.

Issue has already been mentioned here for pyenv

uwidev avatar Jun 04 '23 16:06 uwidev

Closing since there's a workaround above for Pyenv users (thanks @uwidev):

Set PYTHON in webui-user.bat to where the Pyenv Python is installed, e.g. %USERPROFILE%\.pyenv\pyenv-win\versions\3.10.6\python.exe

akx avatar Jun 14 '23 10:06 akx

this workaround doesn't work for me...

image image

just runs and crashes silently without any issues in log files checked path multiple times -- everything is ok, but still have silent shutdown...

tigrik2017 avatar Jul 14 '24 16:07 tigrik2017

@tigrik2017: Try python.exe instead of pytohon.exe

AlUlkesh avatar Jul 14 '24 20:07 AlUlkesh

@tigrik2017: Try python.exe instead of pytohon.exe

Funny typo, but result is the same...

tigrik2017 avatar Jul 14 '24 21:07 tigrik2017

What do you get when you start it from the commandline?

%USERPROFILE%\.pyenv\pyenv-win\versions\3.10.6\python.exe -VV

AlUlkesh avatar Jul 14 '24 21:07 AlUlkesh

What do you get when you start it from the commandline?

%USERPROFILE%\.pyenv\pyenv-win\versions\3.10.6\python.exe -VV

image

also to add

it works from cmd (not power shell) using %USERPROFILE% variable, but running webui-user.bat from cmd just hangs with empty line right after run. Nothin added to the logs....

tigrik2017 avatar Jul 14 '24 21:07 tigrik2017

For debugging it would be helpful if you remove the first line in webui.bat (@echo off). Then you should be able to see how far it gets.

AlUlkesh avatar Jul 14 '24 21:07 AlUlkesh

it turned out that I've edited one instance of automatic1111, an tried to run another one... Now after updating the proper one I've got another "picture" of the situation....

image

tigrik2017 avatar Jul 14 '24 21:07 tigrik2017

restoring "modules" directory from repo fixed the issue... My bad... Now it began to install Thanks anyway =)

tigrik2017 avatar Jul 14 '24 21:07 tigrik2017