RuntimeError: Couldn't install torch #4641
Replies: 5 comments 4 replies
-
I'm really bad with this Git stuff but I've managed to solve a similar problem by copying and pasting the things that won't install, torch and torchvision for you, at the end of your requirements.txt file, then I do a Gitbash thing and paste in |
Beta Was this translation helpful? Give feedback.
-
I downloaded the file "torch and torchvision" mhl file to my computer, but I don't know how to change the startup so that it uses the one I downloaded, and not start downloading a new one |
Beta Was this translation helpful? Give feedback.
-
This is some absurd windows-only error and there won't be an easy fix. I just checked and saw some reports that fully clean installation of python on different disk volume helps, clean install of every package (i.e. deleting venv folder) may help. Reinstalling the Windows itself will probably help too. Anyway its not at all specific issue to this repository. ContinuumIO/anaconda-issues#11949 |
Beta Was this translation helpful? Give feedback.
-
your python version is too new for torch, I solved by installing python 3.10.6 |
Beta Was this translation helpful? Give feedback.
-
A1111 installer 1.94 isn't creating it's /venv folder properly, and it's trying to use pip before a venv is created. on Arch (and probably most sensible distributions) pip can't be used outside of a venv. So the installer doesn't even start. Even after python 3.10 is specified in webui-user.sh. In the past, the Venv folder was always automatically generated by webui.sh once it's been deleted, but it's not doing that anymore so there's no /venv folder at all. This doesn't seem right. Also it would be great if there was a command at the end of webui.sh that held the terminal open saying "press any key to continue" once it's exited unexpectedly so one can see the log in order to make corrections. I appended the webui.sh file with the following line to do that: |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I ask for help, because the same error is repeated on different versions of Stable Diffusion.
I do everything according to the instructions, but after the final launch * bat file starts this error. I'll paste the log below
Creating venv in directory venv using python "F:\Python310\python.exe"
venv "C:\Stable DIffusion\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: 98947d1
Installing torch and torchvision
Traceback (most recent call last):
File "C:\Stable DIffusion\launch.py", line 255, in
prepare_enviroment()
File "C:\Stable DIffusion\launch.py", line 173, in prepare_enviroment
run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch")
File "C:\Stable DIffusion\launch.py", line 34, in run
raise RuntimeError(message)
RuntimeError: Couldn't install torch.
Command: "C:\Stable DIffusion\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:
stderr: Traceback (most recent call last):
File "F:\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "F:\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Stable DIffusion\venv\lib\site-packages\pip_main.py", line 29, in
from pip._internal.cli.main import main as _main
File "C:\Stable DIffusion\venv\lib\site-packages\pip_internal\cli\main.py", line 9, in
from pip._internal.cli.autocompletion import autocomplete
File "C:\Stable DIffusion\venv\lib\site-packages\pip_internal\cli\autocompletion.py", line 10, in
from pip._internal.cli.main_parser import create_main_parser
File "C:\Stable DIffusion\venv\lib\site-packages\pip_internal\cli\main_parser.py", line 8, in
from pip._internal.cli import cmdoptions
File "C:\Stable DIffusion\venv\lib\site-packages\pip_internal\cli\cmdoptions.py", line 24, in
from pip._internal.cli.parser import ConfigOptionParser
File "C:\Stable DIffusion\venv\lib\site-packages\pip_internal\cli\parser.py", line 12, in
from pip._internal.configuration import Configuration, ConfigurationError
File "C:\Stable DIffusion\venv\lib\site-packages\pip_internal\configuration.py", line 20, in
from pip._internal.exceptions import (
File "C:\Stable DIffusion\venv\lib\site-packages\pip_internal\exceptions.py", line 13, in
from pip.vendor.requests.models import Request, Response
File "C:\Stable DIffusion\venv\lib\site-packages\pip_vendor\requests_init.py", line 149, in
from . import packages, utils
File "C:\Stable DIffusion\venv\lib\site-packages\pip_vendor\requests\utils.py", line 47, in
from .cookies import cookiejar_from_dict
File "", line 1027, in _find_and_load
File "", line 1006, in _find_and_load_unlocked
File "", line 688, in _load_unlocked
File "", line 879, in exec_module
File "", line 1016, in get_code
File "", line 1074, in get_data
OSError: [Errno 9] Bad file descriptor
Beta Was this translation helpful? Give feedback.
All reactions