Stable Diffusion WebUI Installation Errors & Solutions Summary
1. Python-related errors
Error 1: Python version is not correct
cmd>>>
This Python version (3.x.x) is unsupported.
|
Solution
Stable Diffusion WebUI recommends Python 3.10.x.
1)Uninstall existing Python
2).Download and install Python 3.10.
3).Re-run after installation
2. Error related to virtual environment (venv)
Error 2: venv virtual environment problem
cmd>>>
AttributeError: module 'importlib._bootstrap' has no attribute ‘ SourceFileeloder’
|
Solution
!) Delete existing venv and re-create it
cmd>>>
rm -rf venv
python -m venv venv
|
2) Reinstall
cmd>>>
venv\Scripts\activate # (Windows)
source venv/bin/activate # (Linux/Mac)
pip install -r requirements.txt
|
3. Torch/PyTorch related errors
Error 3: PyTorch not installed or version error
cmd>>>
No module named 'torch'
|
Solution
Reinstall PyTorch.
- CUDA 11.8 (NVIDIA GPU):
cmd>>>
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
|
- CUDA 12:
cmd>>>
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
|
- If you don't have a GPU (CPU only):
cmd>>>
pip install torch torchvision torchaudio
|
Check the installation:
py>
import torch
print(torch.__version__)
print(torch.cuda.is_available()) # If True, GPU is available
|
4. Errors related to xformers (speed optimization package)
Error 4: Problem installing xformers
cmd>>>
No module named 'xformers'
|
Solution
Install xformers manually.
cmd>>>
pip install xformers
|
- Check installation:
py>
import xformers
print("xformers installed successfully")
|
5. CUDA related errors
Error 5: CUDA related execution error
cmd>>>
torch.cuda.OutOfMemoryError: CUDA out of memory.
|
Solution
1) Add an option to save VRAM when running
cmd>>>
python launch.py --medvram --disable-nan-check
|
2) In more severe cases:
cmd>>>
python launch.py --lowvram
|
3) If that doesn't work, add the --opt-sdp-attention option
6. WebUI execution error
Error 6: Port conflict while running WebUI
cmd>>>
OSError: [Errno 98] Address already in use
|
Solution
1) Check running processes
- Windows: netstat -ano | findstr :7860
- Linux: lsof -i :7860
2) End the process
- Windows: taskkill /PID [PID] /F
- Linux: kill -9 [PID]
3) Use a different port when running WebUI:
cmd>>>
python launch.py --port 7870
|
7. Model download error
Error 7: Checkpoint model is missing or corrupted
cmd>>>
ERROR: Model not found: model.ckpt
|
Solution
1. Download the model directly
Save to the models/Stable-diffusion folder
8. Requirements installation error
Error 8: Requirements.txt installation error
cmd>>>
ERROR: Could not find a version that satisfies the requirement
|
Solution
1) update the package to the latest version
cmd>>>
pip install --upgrade pip setuptools wheel
|
2) Install requirements again
cmd>>>
pip install -r requirements.txt
|
9. Black screen or no UI after execution
Error 9: UI not visible after execution
Solution
1) Check the correct URL
- Check if you accessed http://127.0.0.1:7860 after execution
2) Delete browser cache and try again
- Chrome: Ctrl + Shift + R
3) Run on a different port
cmd>>>
python launch.py --port 8000
|
10. Update error
Error 10: git pull problem during update
cmd>>>
error: Your local changes to the following files would be overwritten
|
Solution
1) Revert the changed files to the original and update
cmd>>>
git reset --hard
git pull
|
2) If that doesn't work, update manually
cmd>>>
rm -rf stable-diffusion-webui
|
11.Couldn't launch python, exit code 9009
Error 11 :
Couldn't launch python
exit code: 9009
Solution
When I open the webui-user.bat I got this error
'CALL C:\python\python.exe -c "import sys; print(sys.executable)"' is not recognized as an internal or external command, operable program or batch file. Creating venv in directory venv using python Unable to create venv in directory venv
exit code: 9009
stderr: '-m' is not recognized as an internal or external command, operable program or batch file.
Launch unsuccessful. Exiting. Press any key to continue . . .
Is there anything wrong when I install python or anything else?
Uninstall Python, install it again, don't forget to check the "PATH" box when installing, then when editing the .bat, write this:
Here's an example:
set PYTHON=C:\Users\You\AppData\Local\Programs\Python\Python310\python.exe