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

[Bug]:ERROR: No matching distribution found for torch==1.12.1+cu113

Open khosta1 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?

webui-user can't find any correct version of torch to install i tried multiple version of python and install torch through consol but same error.

Steps to reproduce the problem

  1. Go to webui-user.bat
  2. Press enter
  3. and wait

What should have happened?

A problem of communication with torch site

Commit where the problem happens

Microsoft Windows [version 10.0.19043.2130]

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

Google Chrome

Command Line Arguments

No response

Additional information, context and logs

image

venv "D:\Programmes\stable diffusion\stable-diffusion-webui-master\venv\Scripts\Python.exe" Python 3.11.0 (main, Oct 24 2022, 18:26:48) [MSC v.1933 64 bit (AMD64)] Commit hash: Installing torch and torchvision Traceback (most recent call last): File "D:\Programmes\stable diffusion\stable-diffusion-webui-master\launch.py", line 251, in prepare_enviroment() File "D:\Programmes\stable diffusion\stable-diffusion-webui-master\launch.py", line 169, in prepare_enviroment run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch") File "D:\Programmes\stable diffusion\stable-diffusion-webui-master\launch.py", line 34, in run raise RuntimeError(message) RuntimeError: Couldn't install torch. Command: "D:\Programmes\stable diffusion\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: 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: none) ERROR: No matching distribution found for torch==1.12.1+cu113

khosta1 avatar Nov 05 '22 18:11 khosta1

If you have a NVIDIA card, try this (I just tested it):

  • delete the venv folder if you have it
  • open the webui-user.bat file and in the set PYTHON= line type the python 3.10 path, e.g.: set PYTHON=C:\Python\Python310\python.exe
  • save and start the webui-user.bat file and everything will be installed.

mykeehu avatar Nov 05 '22 19:11 mykeehu

khosta1 Python 3.11.x is not yet supported it's missing all pytorch files. You've to use 3.10.x

dhwz avatar Nov 05 '22 22:11 dhwz

I had the same issue. It was an issue with having Python 3.11 installed.

JetKodiak avatar Nov 21 '22 14:11 JetKodiak

I deleted the new version and installed python 3.10.8 and the problem disappeared.

nedfreetoplay avatar Nov 24 '22 03:11 nedfreetoplay

Problem is still appearing on Python 3.10.6. image

GD-alt avatar Dec 03 '22 11:12 GD-alt

@GD-alt in such cases I simply solved the problem:

  • updated the program with git pull
  • with these steps I rebuilt the framework and it worked.

mykeehu avatar Dec 03 '22 14:12 mykeehu

I had the same problem and I solved it by reinstalling Python in my system from new version 3.11.0 to old version 3.10.7. More specifically:

  • Uninstalled all versions of Python from Add/remove programs.
  • Restarted the system.
  • Deleted all Python-related folders from C:\Program files and C:\Users\MY_LOGIN...
  • In This PC > Properties > ... > PATH environmental variable, deleted all Python-related paths.
  • Installed Python 3.10.7.
  • Restarted the system.
  • Deleted folder stable-diffusion-webui\venv.
  • Launched stable-diffusion-webui\webui.bat and let it download and install everything from scratch.

sawickiap avatar Dec 04 '22 21:12 sawickiap

I am experiencing a similar issue:

[Already up to date. venv "C:\Users\zfurb\stable-diffusion-webui\venv\Scripts\Python.exe" Python 3.11.1 (tags/v3.11.1:a7a450f, Dec 6 2022, 19:58:39) [MSC v.1934 64 bit (AMD64)] Commit hash: 685f9631b56ff8bd43bce24ff5ce0f9a0e9af490 Installing torch and torchvision Traceback (most recent call last): File "C:\Users\zfurb\stable-diffusion-webui\launch.py", line 294, in prepare_environment() File "C:\Users\zfurb\stable-diffusion-webui\launch.py", line 206, in prepare_environment run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch") File "C:\Users\zfurb\stable-diffusion-webui\launch.py", line 49, in run raise RuntimeError(message) RuntimeError: Couldn't install torch. Command: "C:\Users\zfurb\stable-diffusion-webui\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: Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu113

stderr: WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/torch/ WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None))': /simple/torch/ ERROR: Could not find a version that satisfies the requirement torch==1.12.1+cu113 (from versions: none) ERROR: No matching distribution found for torch==1.12.1+cu113

Press any key to continue . . .]

The issue persists from python 3.10.6 all the way to 3.11, wiping the entire python program, removing stable diffusion from the drive and doing fresh installs has no effect on the issue. The above is an example of my 3rd full install attempt. The program worked flawlessly for about a week (aside from not utilizing enough ram and using the pagefile as a cache file which it never bothered to clear when it was done. But this is most likely because I am using a windows 10 computer instead of linux like the majority of users seem to be on) using 3.10.6 but yesterday I tried to run the .bat file and it spit out malicious code warnings with stable diffusion 1.5 and 2.1 as well as webui.py all detecting themselves as malicious code and the cmd prompt refused to let me run the program even with the disable safe pickle check (or however its written). I started trying to do a fresh install but ran into the same issue others are reporting here with one additional problem: pip will no longer run with 3.10.6 and demands that I update it (pip) to a newer version which only works with 3.11 meaning I either have to run into a pip error code or into a torch error code.

RuseTiger avatar Dec 15 '22 02:12 RuseTiger

If you've installed python=3.11.x and you don't want to reinstall old python version in your system.

  • Use conda to create a new env with python=3.10, then conda install git after activate your new env
  • Delete venv folder
  • Edit the webui-user.bat file and ensure that the line set PYTHON= remain unchanged. DO NOT ADD PATH TO IT.
  • Navigate to the '/stable-diffusion-webui' folder, activate your new env, type 'webui-user.bat'

I solved problem in this way.

SawyerSong223 avatar Dec 20 '22 07:12 SawyerSong223

What worked for me was:

  • install python 3.10.9
  • go to venv folder and edit pyenv.cfg in notepad
  • change all the directories mentioned to the directory python 3.10.9 was installed in
    • if Python 3.10.9 is in Program Files, for the home directory do not include quotation marks in the path; for the executable path, do leave the quotation marks in the path
  • change version to 3.10.9
  • save, rerun webui.bat

jonnet97030 avatar Jan 12 '23 19:01 jonnet97030

Here's an extremely efficient and easy way to solve this which doesn't involve restarts, uninstalling, etc,.

  • Download torch-1.12.1+cu113-cp310-cp310-linux_x86_64.whl. Select appropriate version based on your OS and Python. stable-diffusion-webui recommends python 3.10 so linked version should work for most of people. Copy the downloaded torch version to stable-diffusion-webui folder root.
  • Open a cmd in your stable-diffusion-webui root folder and manually activate your virtual environment by typing this "venv/Scripts/activate". If you're on Windows like me include the quotations "" too while typing the command.
  • Use command pip install "torch-1.12.1+cu113-cp310-cp310-win_amd64.whl" while this virtual environment is active.
  • Issue should be gone now. You can do same for torchvision if facing issues.

Extra tip - You can always go here - https://download.pytorch.org/whl/cu113/ and check what compiled and pre-built torch packages are available. Replace "cu113" with whatever cuda version you might have.

zz-xx avatar Jan 22 '23 10:01 zz-xx

Just Download a version working of phyton and make happiness, https://www.python.org/downloads/release/python-31011/

kutpenco avatar Apr 22 '24 19:04 kutpenco