stable-diffusion-webui
stable-diffusion-webui copied to clipboard
[Bug]: "Couldn't Install Torch" could not find torch issue
Is there an existing issue for this?
- [X] I have searched the existing issues and checked the recent builds/commits
What happened?
Installing torch and torchvision
Traceback (most recent call last):
File "C:\Users\BENJIII\stable-diffusion-webui\launch.py", line 306, in
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
when clicking on webuiuser folder to run program
Steps to reproduce the problem
- download python
- download git
- download stable diffusion
- download model folder
- set folder to models location in C:\users folder 7.right click on webui-user, go to edit add in "git pull"
- fill in python section with folder location of python
- run webui
What should have happened?
the program should have ran and spat out a web address for me to go to
Commit where the problem happens
bd4587d2f5b70ed951d2c17f25a4622fc1cb31c2
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
What's your Python version? In case it's not 3.10.6, uninstall Python, Install 3.10.6 from here
cant be a newer version?
I was getting the same error, uninstalled python and installed the correct version, now I'm getting an error 'no python at ....' the location where the newer version of python was installed. How do we correctly uninstall the wrong version of python and add the right one (there is no reference to the wrong version in the path variable)
I was getting the same error, uninstalled python and installed the correct version, now I'm getting an error 'no python at ....' the location where the newer version of python was installed. How do we correctly uninstall the wrong version of python and add the right one (there is no reference to the wrong version in the path variable)
That makes two of us....I'm getting that same error after thinking "If it's going to be a newer Python, it's going to be retro compatible...how foolish can I be?
cannot be 3.11. Any version from 3.8 to 3.10 works. No need to be 3.10.6 as that's outdated
I was getting the same error, uninstalled python and installed the correct version, now I'm getting an error 'no python at ....' the location where the newer version of python was installed. How do we correctly uninstall the wrong version of python and add the right one (there is no reference to the wrong version in the path variable)
That makes two of us....I'm getting that same error after thinking "If it's going to be a newer Python, it's going to be retro compatible...how foolish can I be?
After installing the correct version of python 3.10.x, my solution was to delete the 'venv' folder out of your stable-diffusion-webui-master' directory. then hit the bat again.
I was getting the same error, uninstalled python and installed the correct version, now I'm getting an error 'no python at ....' the location where the newer version of python was installed. How do we correctly uninstall the wrong version of python and add the right one (there is no reference to the wrong version in the path variable)
That makes two of us....I'm getting that same error after thinking "If it's going to be a newer Python, it's going to be retro compatible...how foolish can I be?
After installing the correct version of python 3.10.x, my solution was to delete the 'venv' folder out of your stable-diffusion-webui-master' directory. then hit the bat again.
That worked for me. Thank you so much.
The simplest solution seems to be:
- Disable Windows defender or any applicable virus software (temporarily)
- Run CMD and navigate to the folder where you installed Python 3.10.6
- Then type python -m ensurepip
Everything should now work as normal.
You may also have to turn off the app installer for all versions of python in the "Manage app execution aliases" window if running on Windows 10 or later.
This was a pain that took me days so I'll share what finally worked for me. As far as it went for me, the real issue was pip screwing up when downloading pytorch. No idea why, it just was. To do this fix, first make sure you are using Python 3.10.6; would be a waste of time to do it and get the wrong version that breaks it anyways.
- CD into your stable-diffusion-webui/venv/Scripts folder, it's all gonna go down here
- You'll need Wheel for this, so start with a
python.exe -m pip install --upgrade pip setuptools wheel
- Download this file; it's the .whl file that your webui keeps trying to but never managing to get; if you don't wanna trust a random poster, you can easily look for it on pytorch's website. Just look for version 1.13.1, Instead of downloading it with
pip install
try to run it once, it'll show you the exact download link python is trying to use; you can just copy that and throw into your browser and voilá - After downloading the wheel file, copy it's address in your system and go back to the prompt you had inside your Scripts folder
- Run
python.exe -m pip install your/wheel/file/directory.whl
This will basically force pytorch down webui's throat, and the rest of the instalation should proceed as expected. Hope this helps!
PS.: If pytorch is not downloading for you on cmd, odds are it won't download on a regular browser downloader either (the download failed 3 times for me at the same point it broke down on the cmd) so I suggest using some sort of manager that keeps downloads from failing when connection is briefly lost; I used FDM and it worked first time PPS.: I am like, 99% sure that you'd need Wheel even without going this method, that is a .whl file you're downloading after all; why the webui script doesn't take this into account and install it is beyond me
@mordtirith when running the installation of the wheel file i get the error: ERROR: torch-1.13.1+cu117-cp310-cp310-win_amd64.whl is not a supported wheel on this platform.
i use windows 11 if thats the problem
are you on python 3.10?
No, 3.11.2, oh yes i see my error
Then thats the problem. The wheel is build for python 3.10
If you run the stable diffusion with a different Python version, than what your system is using generally/ by default is set to use, you need to check the following "stable-diffusion-webui\venv\pyvenv.cfg" and set the home/executable/command variable to the python 3.10.6 installation. That will make the execution and torch installation work.
I had the same problem with Win, works just fine for now.
If you're running Linux with multiple versions of Python, you can edit webui.sh
to point to python3.10
(the parallel install name of 3.10 in my case) instead of python3
which may default to > Python 3.11
Delete the broken venv and then re-run webui.sh
and then have another go
If you're running Linux with multiple versions of Python, you can edit
webui.sh
to point topython3.10
(the parallel install name of 3.10 in my case) instead ofpython3
which may default to > Python 3.11Delete the broken venv and then re-run
webui.sh
and then have another go
You save my day
This was a pain that took me days so I'll share what finally worked for me. As far as it went for me, the real issue was pip screwing up when downloading pytorch. No idea why, it just was. To do this fix, first make sure you are using Python 3.10.6; would be a waste of time to do it and get the wrong version that breaks it anyways.
- CD into your stable-diffusion-webui/venv/Scripts folder, it's all gonna go down here
- You'll need Wheel for this, so start with a
python.exe -m pip install --upgrade pip setuptools wheel
- Download this file; it's the .whl file that your webui keeps trying to but never managing to get; if you don't wanna trust a random poster, you can easily look for it on pytorch's website. Just look for version 1.13.1, Instead of downloading it with
pip install
try to run it once, it'll show you the exact download link python is trying to use; you can just copy that and throw into your browser and voilá- After downloading the wheel file, copy it's address in your system and go back to the prompt you had inside your Scripts folder
- Run
python.exe -m pip install your/wheel/file/directory.whl
This will basically force pytorch down webui's throat, and the rest of the instalation should proceed as expected. Hope this helps!
PS.: If pytorch is not downloading for you on cmd, odds are it won't download on a regular browser downloader either (the download failed 3 times for me at the same point it broke down on the cmd) so I suggest using some sort of manager that keeps downloads from failing when connection is briefly lost; I used FDM and it worked first time PPS.: I am like, 99% sure that you'd need Wheel even without going this method, that is a .whl file you're downloading after all; why the webui script doesn't take this into account and install it is beyond me
Been working on this issue for a while and I followed these steps, CMD tells me torch is installed. Wondering about the next step since running the webui-user.bat just starts downloading the file again, and eventually gives me the same error as before. How do I tell it that the file is already downloaded? or does this mean that I am having a different issue...
I renamed venv as BAD_venv and it seems to be working fine now. Thanks to whomever suggested venv as the culprit.
This was a pain that took me days so I'll share what finally worked for me. As far as it went for me, the real issue was pip screwing up when downloading pytorch. No idea why, it just was. To do this fix, first make sure you are using Python 3.10.6; would be a waste of time to do it and get the wrong version that breaks it anyways.
- CD into your stable-diffusion-webui/venv/Scripts folder, it's all gonna go down here
- You'll need Wheel for this, so start with a
python.exe -m pip install --upgrade pip setuptools wheel
- Download this file; it's the .whl file that your webui keeps trying to but never managing to get; if you don't wanna trust a random poster, you can easily look for it on pytorch's website. Just look for version 1.13.1, Instead of downloading it with
pip install
try to run it once, it'll show you the exact download link python is trying to use; you can just copy that and throw into your browser and voilá- After downloading the wheel file, copy it's address in your system and go back to the prompt you had inside your Scripts folder
- Run
python.exe -m pip install your/wheel/file/directory.whl
This will basically force pytorch down webui's throat, and the rest of the instalation should proceed as expected. Hope this helps! PS.: If pytorch is not downloading for you on cmd, odds are it won't download on a regular browser downloader either (the download failed 3 times for me at the same point it broke down on the cmd) so I suggest using some sort of manager that keeps downloads from failing when connection is briefly lost; I used FDM and it worked first time PPS.: I am like, 99% sure that you'd need Wheel even without going this method, that is a .whl file you're downloading after all; why the webui script doesn't take this into account and install it is beyond me
Been working on this issue for a while and I followed these steps, CMD tells me torch is installed. Wondering about the next step since running the webui-user.bat just starts downloading the file again, and eventually gives me the same error as before. How do I tell it that the file is already downloaded? or does this mean that I am having a different issue...
I had the same issue and resolved it by using the method posted by 105000907 but installing the version of the torch .whl file that webui-user.bat kept trying to install, in my case 2.0.1. The webui-user.bat install logs actually provide a direct link to the .whl file that it tries to install, so I copied that. Finally up and running.
THANK YOU to 105000907 for posting that solution.
This was a pain that took me days so I'll share what finally worked for me. As far as it went for me, the real issue was pip screwing up when downloading pytorch. No idea why, it just was. To do this fix, first make sure you are using Python 3.10.6; would be a waste of time to do it and get the wrong version that breaks it anyways.
- CD into your stable-diffusion-webui/venv/Scripts folder, it's all gonna go down here
- You'll need Wheel for this, so start with a
python.exe -m pip install --upgrade pip setuptools wheel
- Download this file; it's the .whl file that your webui keeps trying to but never managing to get; if you don't wanna trust a random poster, you can easily look for it on pytorch's website. Just look for version 1.13.1, Instead of downloading it with
pip install
try to run it once, it'll show you the exact download link python is trying to use; you can just copy that and throw into your browser and voilá- After downloading the wheel file, copy it's address in your system and go back to the prompt you had inside your Scripts folder
- Run
python.exe -m pip install your/wheel/file/directory.whl
This will basically force pytorch down webui's throat, and the rest of the instalation should proceed as expected. Hope this helps! PS.: If pytorch is not downloading for you on cmd, odds are it won't download on a regular browser downloader either (the download failed 3 times for me at the same point it broke down on the cmd) so I suggest using some sort of manager that keeps downloads from failing when connection is briefly lost; I used FDM and it worked first time PPS.: I am like, 99% sure that you'd need Wheel even without going this method, that is a .whl file you're downloading after all; why the webui script doesn't take this into account and install it is beyond me
Been working on this issue for a while and I followed these steps, CMD tells me torch is installed. Wondering about the next step since running the webui-user.bat just starts downloading the file again, and eventually gives me the same error as before. How do I tell it that the file is already downloaded? or does this mean that I am having a different issue...
I had the same issue and resolved it by using the method posted by 105000907 but installing the version of the torch .whl file that webui-user.bat kept trying to install, in my case 2.0.1. The webui-user.bat install logs actually provide a direct link to the .whl file that it tries to install, so I copied that. Finally up and running.
THANK YOU to 105000907 for posting that solution.
I did that, but still webui-user.bat tries to download torch itself...
Closing as stale.
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/6592#issuecomment-1507025717 @aidenbell What is particular did you change? I changed line 47 python_cmd="python3" and the script would not run. "3.10.0 not installed" Thanks.