I need help installing Python for Stable Diffusion and am coming across this error message

Hello,

I am struggling with running stable diffusion. I have followed some detailed instructions to the T and now when it should process everything and eventually boot it just gives out this error message:

venv "C:\Users\Clementine\Desktop\SUMMER OF LOVE 89 TEST VIDEOS\stable-diffusion-webui-master\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
Traceback (most recent call last):
  File "C:\Users\Clementine\Desktop\SUMMER OF LOVE 89 TEST VIDEOS\stable-diffusion-webui-master\launch.py", line 306, in <module>
    prepare_environment()
  File "C:\Users\Clementine\Desktop\SUMMER OF LOVE 89 TEST VIDEOS\stable-diffusion-webui-master\launch.py", line 218, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch")
  File "C:\Users\Clementine\Desktop\SUMMER OF LOVE 89 TEST VIDEOS\stable-diffusion-webui-master\launch.py", line 64, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install torch.
Command: "C:\Users\Clementine\Desktop\SUMMER OF LOVE 89 TEST VIDEOS\stable-diffusion-webui-master\venv\Scripts\python.exe" -m pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113
Error code: 1
stdout: <empty>
stderr: C:\Users\Clementine\Desktop\SUMMER OF LOVE 89 TEST VIDEOS\stable-diffusion-webui-master\venv\Scripts\python.exe: No module named pip

Press any key to continue . . .

I am very green in the realm of command prompts and i’m struggling to dichipher all of this. Any help would be appriciated if possible :slight_smile:

When adding code or terminal output to your post, please make sure you enclose it in code fencing so it is formatted correctly for others to be able to read and copy, as I’ve done for you this time. You can do so with the </> button in the toolbar, or via typing triple backticks above and below the code in question, optionally with the language name (e.g. cmd) for syntax highlighting, like this:

```cmd
<YOUR CODE HERE>
```

What instructions are you following to get stable diffusion going?
I needed a guide as it is complex and it took a couple of attempts.

No module named pip

You are missing pip. Usually this is installed by the Python installer on Windows. How did you install Python? Did you use the installer? (Don’t use the “embeddable package” zip. It does not include pip and is intended only for certain special use cases.)

I used the following link to downlad python:

I am using the windows installer 64 bit (recommended)
Now it is beginning to run on the text prompt but fails and says it cannot find torch after about 40 minutes

[notice] A new release of pip available: 22.2.1 -> 23.0.1
[notice] To update, run: C:\StableDiffusion\stable-diffusion-webui\venv\Scripts\python.exe -m pip install --upgrade pip
Traceback (most recent call last):
  File "C:\StableDiffusion\stable-diffusion-webui\launch.py", line 380, in <module>
    prepare_environment()
  File "C:\StableDiffusion\stable-diffusion-webui\launch.py", line 284, in prepare_environment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True)
  File "C:\StableDiffusion\stable-diffusion-webui\launch.py", line 97, in run
    raise RuntimeError(f"""{errdesc or 'Error running command'}.
RuntimeError: Couldn't install torch.
Command: "C:\StableDiffusion\stable-diffusion-webui\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 had to fix your code block again; please re-read my comment above carefully.

I’m not asking how you are installing python.

I am asking what instructions you are using to install stable diffusion.
What web page is guiding you through the complex steps required to get this going?

It sounds like they use this: GitHub - AUTOMATIC1111/stable-diffusion-webui: Stable Diffusion web UI
which attempts to automate all the steps, which makes it more difficult to know what actually fails.

Try the command it says failed individually.

Which, for the record, appears to be

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