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

[Bug]: RuntimeError: Couldn't install torch

Open wrabit opened this issue 1 year ago • 11 comments

Is there an existing issue for this?

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

What happened?

Running webui.sh, I am getting:

################################################################
Python 3.10.6 (main, Oct 24 2022, 11:04:07) [Clang 12.0.0 ]
Commit hash: 737eb28faca8be2bb996ee0930ec77d1f7ebd939
Installing torch and torchvision
Traceback (most recent call last):
  File "/Users/will/Code/stable-fusion-gui/stable-diffusion-webui/launch.py", line 205, in <module>
    prepare_enviroment()
  File "/Users/will/Code/stable-fusion-gui/stable-diffusion-webui/launch.py", line 148, in prepare_enviroment
    run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch")
  File "/Users/will/Code/stable-fusion-gui/stable-diffusion-webui/launch.py", line 33, in run
    raise RuntimeError(message)
RuntimeError: Couldn't install torch.
Command: "/Users/will/Code/stable-fusion-gui/stable-diffusion-webui/venv/bin/python3" -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: Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113

stderr: ERROR: Could not find a version that satisfies the requirement torch==1.12.1+cu113 (from versions: 1.11.0, 1.12.0, 1.12.1)
ERROR: No matching distribution found for torch==1.12.1+cu113

[notice] A new release of pip available: 22.2.1 -> 22.3
[notice] To update, run: pip install --upgrade pip

Steps to reproduce the problem

Run webui.sh

What should have happened?

Completed without errors?

Commit where the problem happens

f53ca51

What platforms do you use to access UI ?

MacOS

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No response

Additional information, context and logs

No response

wrabit avatar Oct 27 '22 10:10 wrabit

You need set webui-user.sh file. line 13 for example:

export COMMANDLINE_ARGS="--lowvram --precision full --no-half --skip-torch-cuda-test"

But I don't know the description of the parameters, hope someone can explain, thank.

ordinarycas avatar Oct 27 '22 15:10 ordinarycas

same issue

bran112299 avatar Oct 27 '22 23:10 bran112299

Same issue. Line 13 webui-user.sh parameter mentioned above does not resolve.

Bangeo69 avatar Oct 28 '22 03:10 Bangeo69

same issue here

image

superboychao avatar Oct 28 '22 07:10 superboychao

@superboychao someone in the other thread reported downgrading from python 3.11 solved it for them https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/3780#issuecomment-1294241333

wrabit avatar Oct 28 '22 10:10 wrabit

@superboychao someone in the other thread reported downgrading from python 3.11 solved it for them #3780 (comment)

Downgrade python 3.11>3.10 also just worked for me. Thanks.

Bangeo69 avatar Oct 28 '22 16:10 Bangeo69

Python 3.11 is said to have up to 60% speed boost, in general around 20% for most python functions, see official release notes (https://docs.python.org/3.11/whatsnew/3.11.html). It is a large performance upgrade. Even if it only speeds up python functions and not necessarily will produce more it/s, I would appreciate if SD-Webui and xformers would support running with python 3.11

CmdrMichael avatar Oct 30 '22 05:10 CmdrMichael

@superboychao someone in the other thread reported downgrading from python 3.11 solved it for them #3780 (comment)

Downgrade python 3.11>3.10 also just worked for me. Thanks.

I had the same problem on Windows, tried downgrading to 3.10.8 and now running webui.bat is telling me: "No Python at '"C:\Users\Sparky\AppData\Local\Programs\Python\Python311\python.exe'"

walrusthief avatar Nov 03 '22 21:11 walrusthief

@superboychao someone in the other thread reported downgrading from python 3.11 solved it for them #3780 (comment)

Downgrade python 3.11>3.10 also just worked for me. Thanks.

Encountered this error when using python 3.11 and resolved it by installing 3.10.6.

Splode avatar Nov 03 '22 22:11 Splode

when will the gui be python 3.11 ready ???

Serasul1984 avatar Nov 04 '22 19:11 Serasul1984

downgrade worked

DuckyBlender avatar Nov 05 '22 00:11 DuckyBlender

Im running on 3.10.6 And I got the same problem.

B3Kay avatar Dec 14 '22 15:12 B3Kay