stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: RuntimeError: Couldn't Install Torch
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
Running web-ui.bat throws up this error:
venv "C:\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:
I've tried uninstalling torch, manually installing it, removing it again, updating python to version 11, then downgrading it first to 10.8, then to 10.6.
Steps to reproduce the problem
- Go to root stable-diffusion-webui-master
- Click webui-user.bat or webui.bat
- Error Codes Ensue
What should have happened?
It should have installed Torch and Torchvision and moved on to the next step.
Commit where the problem happens
It says
What platforms do you use to access UI ?
Windows
What browsers do you use to access the UI ?
Microsoft Edge
Command Line Arguments
No response
Additional information, context and logs
No response
I have the same issue when trying to run webui.bat
managed to fix this ---- in my case it was an issue with my version of miniconda, I uninstalled it, restarted my computer, installed python 3.10 with all the admin privileges and environment variables and removed the venv folder in my stable diffusion dir, then ran webui.bat again and waited a long time and it all worked :) I followed this answer here https://stackoverflow.com/a/74262982/12831107
Can someone help with this issue please?
Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Commit hash: 828438b4a190759807f9054932cae3a8b880ddf1
Traceback (most recent call last):
File "C:\Ai\Stable-Diffusion\stable-diffusion-webui\launch.py", line 250, in
If anyone tried all the options and still can't fix it yet, try this: after uninstalling python there are still some files at users/yourusername/AppData. I installed and uninstalled for like 6-7 times with all different options like trying a different HDD, different root name etc. and still gave "Couldn't install torch" error. I don't know how, but it worked for me when I deleted all Python and pip files at AppData and then tried a clean installation of Python and Stable Diffusion WebUI. Good luck.
For anyone else running into this error: you have to use exactly Python 3.10.6
(as of December 2022).
Torch doesn't support newer versions so if you did the obvious thing and installed the latest Python (3.11 right now) then it won't work, or give you any helpful error messages.
This is probably very obvious to people who use Python a lot and not at all obvious to the rest of us.
For anyone else running into this error: you have to use exactly Python
3.10.6
(as of December 2022).
This works, but just to add to this, you also need to delete the 'venv' folder in the root directory of your sdwebui install (ty @spaciousmind). Because when you run the webui.bat file, it will create that folder and it's contents, based on the current version of python you are using.
Good afternoon, I would like to ask if you have managed to solve the problem you are facing? Thank you in advance for the answer!
Deleting venv and rebooting did it for me, didn't need to uninstall or reinstall Python.
For anyone else running into this error: you have to use exactly Python
3.10.6
(as of December 2022).This works, but just to add to this, you also need to delete the 'venv' folder in the root directory of your sdwebui install (ty @spaciousmind). Because when you run the webui.bat file, it will create that folder and it's contents, based on the current version of python you are using.
Thank you, it works!
For anyone else running into this error: you have to use exactly Python
3.10.6
(as of December 2022).Torch doesn't support newer versions so if you did the obvious thing and installed the latest Python (3.11 right now) then it won't work, or give you any helpful error messages.
This is probably very obvious to people who use Python a lot and not at all obvious to the rest of us.
This worked for me, also don't forget to delete venv folder, also don't forget to add it to the environment variables > system variables > path
Help i tried every sollution i could find but nothing works
I tried downloading differents version of python making sure to delete the previous one before and the pip folder in AppData and deleting the venv folder too but it's still wont work here is my error message :
venv "D:\AI\invokeai\stable-diffusion-webui\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: a9fed7c364061ae6efb37f797b6b522cb3cf7aa2
Installing torch and torchvision
D:\AI\invokeai\stable-diffusion-webui\venv\Scripts\python.exe: No module named pip
Traceback (most recent call last):
File "D:\AI\invokeai\stable-diffusion-webui\launch.py", line 380, in
You could try this: https://stackoverflow.com/a/75728535
You could try this: https://stackoverflow.com/a/75728535
didn't work thanks for the help tho
assuming you actually used the link to the correct 3.10 python install that automatic1111 provides ...
( https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe )
and that the issues is not also conflicting 3.11 (or other) python versions in the "environment variables" sections of your windows configuration, the actual solution is editing the PYVENV.CFG file in the VENV Folder to say something like the following (replace paths with YOUR/ACTUAL/PYTHON310/EXE/PATH) :
PYVENV.CFG (edited to remove 3.11 references):
home = C:\Users\YOURUSER\AppData\Local\Programs\Python\Python310
include-system-site-packages = false
version = 3.10
executable = C:\Users\YOURUSER\AppData\Local\Programs\Python\Python310\python.exe
command = C:\Users\YOURUSER\AppData\Local\Programs\Python\Python310\python.exe -m venv C:\Users\YOURUSER\YOURstable-diffusion2FOLDER\venv
---------END FILE-------------- DO THAT. re run webui-user.bat and it should download pytorch and you're good.
This fixed it for me
For anyone else running into this error: you have to use exactly Python
3.10.6
(as of December 2022).This works, but just to add to this, you also need to delete the 'venv' folder in the root directory of your sdwebui install (ty @spaciousmind). Because when you run the webui.bat file, it will create that folder and it's contents, based on the current version of python you are using.
omg this fixed it for me :) deleting the folder! it rebuilds it with the correct info etc