Tuesday, August 8, 2023

Install Python3.11 for Stable Diffusion after Python.310

If you upgraded to python3.11* on Linux => No module named pip error. 

Launching launch.py...
################################################################
Using TCMalloc: libtcmalloc_minimal.so.4
Python 3.11.4 (main, Jun  9 2023, 07:59:55) [GCC 12.3.0]
Version: v1.5.1
Commit hash: 68f336bd994bed5442ad95bad6b6ad5564a5409a
Installing torch and torchvision
/home/user/Downloads/stable-diffusion-webui/venv/bin/python3: No module named pip
Traceback (most recent call last):
 File "/home/user/Downloads/stable-diffusion-webui/launch.py", line 39, in <module>
   main()
 File "/home/user/Downloads/stable-diffusion-webui/launch.py", line 30, in main
   prepare_environment()
 File "/home/user/Downloads/stable-diffusion-webui/modules/launch_utils.py", line 311, in prepare_environment
   run(f'"{python}" -m {torch_command}', "Installing torch and torchvision", "Couldn't install torch", live=True
)
 File "/home/user/Downloads/stable-diffusion-webui/modules/launch_utils.py", line 113, in run
   raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install torch.
Command: "/home/user/Downloads/stable-diffusion-webui/venv/bin/python3" -m pip install torch==2.0.1 torchvision==
0.15.2 --extra-index-url https://download.pytorch.org/whl/cu118
Error code: 1

sudo apt install python3-venv python3-pip

Delete venv folder in Stable Diffusion installation:

/home/user/Downloads/stable-diffusion-webui/venv/

./webui.sh --xformers

Stable Diffusion will install everything, it needs into new venv folder.

On Windows no need to do this. Use python3.10.6.

https://bobbyhadz.com/blog/python-no-module-named-pip

No comments:

Post a Comment