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

Can't install Stable Diffusion.

Open Deejay85 opened this issue 2 years ago • 2 comments

Is there an existing issue for this?

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

What happened?

I get the following error message.

venv "S:\WaifuDiffusion\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)]
Commit hash: <none>
Installing torch and torchvision
S:\WaifuDiffusion\venv\Scripts\python.exe: No module named pip
Traceback (most recent call last):
  File "S:\WaifuDiffusion\launch.py", line 360, in <module>
    prepare_environment()
  File "S:\WaifuDiffusion\launch.py", line 269, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "S:\WaifuDiffusion\launch.py", line 89, in run
    raise RuntimeError(f"""{errdesc or 'Error running command'}.
RuntimeError: Couldn't install torch.
Command: "S:\WaifuDiffusion\venv\Scripts\python.exe" -m pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
Error code: 1

I already checked the environment variables, and they check out okay (even went as far as dropping a Python.exe and .dll files into the root directory of the program itself, and adding that to the PATH variable… It didn't improve anything). I already know I have Python installed, so the question remains why the pip command isn't working.

Steps to reproduce the problem

Run webui.bat

What should have happened?

The dependencies should have been installed, and the program should have launced.

Commit where the problem happens

0cc0ee1

What platforms do you use to access the UI ?

Windows

What browsers do you use to access the UI ?

Microsoft Edge

Command Line Arguments

No

List of extensions

No

Console logs

venv "S:\WaifuDiffusion\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)]
Commit hash: <none>
Installing torch and torchvision
S:\WaifuDiffusion\venv\Scripts\python.exe: No module named pip
Traceback (most recent call last):
  File "S:\WaifuDiffusion\launch.py", line 360, in <module>
    prepare_environment()
  File "S:\WaifuDiffusion\launch.py", line 269, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "S:\WaifuDiffusion\launch.py", line 89, in run
    raise RuntimeError(f"""{errdesc or 'Error running command'}.
RuntimeError: Couldn't install torch.
Command: "S:\WaifuDiffusion\venv\Scripts\python.exe" -m pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 --extra-index-url https://download.pytorch.org/whl/cu117
Error code: 1


### Additional information

_No response_

Deejay85 avatar Feb 27 '23 00:02 Deejay85

In the stable-diffusion-webui folder, enter cmd in the address bar to open a command prompt. In the command prompt, run venv\Scripts\activate.bat then python -m ensurepip. This should install pip.

Or you can delete the venv folder, reinstall python (the one from the Windows Store works, too) and try again. Pip should be installed by default.

missionfloyd avatar Feb 27 '23 02:02 missionfloyd

Not sure if it matters, but this is a fresh install I'm doing. I reinstalled Python, deleted venv, added both \Python\Python310\ and \Python\Python310\Scripts to PATH, and then ran webui.bat, and got the same error message.

There is no activate.bat script, either before I deleted the folder, or after I deleted it.

EDIT: Okay...one small difference.

Creating venv in directory S:\WaifuDiffusion\venv using python "S:\WaifuDiffusion\python.exe"
Unable to create venv in directory "S:\WaifuDiffusion\venv"

exit code: 1

stderr:
Error: Command '['S:\\WaifuDiffusion\\venv\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.

Launch unsuccessful. Exiting.

I already deleted the folder, created a new one with the same name, and it still does that. I've no idea why. I also changed the security by removing all previous users, adding only mine, and setting everything to full control...read only will not go away on the main folder, but oddly enough, none of the files INSIDE the folder have read only enabled. ?_?

EDIT 2: Took a bit of work, but after disabling inheritance for the folder, and putting my current account as the account owner, I somehow got it to work. The read only icon is still there at the folder level, but once inside (again) nothing is highlighted as read only, but for some weird reason, you can now wright files to the folder, which in short means I can actually install the dependences for the program, and get it to work.

I'm not even sure what happened to cause this. I don't think it's due to a format (though I could of course be wrong), or even anything I did, because I don't monkey around with the permission settings unless I can't get access to something (which isn't often).

Deejay85 avatar Feb 27 '23 03:02 Deejay85