stable-diffusion-webui icon indicating copy to clipboard operation
stable-diffusion-webui copied to clipboard

[Bug]: ModuleNotFoundError: No module named 'accelerate'

Open gateway opened this issue 3 years ago • 2 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

What happened?

just did a git pull today and running the bat file threw this error ModuleNotFoundError: No module named 'accelerate'

I noticed that was added to the requirements so ran that to double check, also you can see after the error that I have it installed? :(

C:\Users\evil\Desktop\Work\stablediffusion\stable-diffusion-webui>webui-user.bat
Already up to date.
venv "C:\Users\evil\Desktop\Work\stablediffusion\stable-diffusion-webui\venv\Scripts\Python.exe"
"Checking for accelerate"
"Accelerating"
Traceback (most recent call last):
  File "C:\Users\evil\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Users\evil\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\evil\Desktop\Work\stablediffusion\stable-diffusion-webui\venv\Scripts\accelerate.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'accelerate'
Press any key to continue . . .

C:\Users\evil\Desktop\Work\stablediffusion\stable-diffusion-webui>pip install accelerate
Requirement already satisfied: accelerate in c:\users\evil\appdata\local\programs\python\python310\lib\site-packages (0.14.0)
Requirement already satisfied: numpy>=1.17 in c:\users\evil\appdata\local\programs\python\python310\lib\site-packages (from accelerate) (1.23.3)
Requirement already satisfied: pyyaml in c:\users\evil\appdata\local\programs\python\python310\lib\site-packages (from accelerate) (6.0)
Requirement already satisfied: torch>=1.4.0 in c:\users\evil\appdata\local\programs\python\python310\lib\site-packages (from accelerate) (1.13.0)
Requirement already satisfied: psutil in c:\users\evil\appdata\local\programs\python\python310\lib\site-packages (from accelerate) (5.9.4)
Requirement already satisfied: packaging>=20.0 in c:\users\evil\appdata\local\programs\python\python310\lib\site-packages (from accelerate) (21.3)
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in c:\users\evil\appdata\local\programs\python\python310\lib\site-packages (from packaging>=20.0->accelerate) (3.0.9)
Requirement already satisfied: typing-extensions in c:\users\evil\appdata\local\programs\python\python310\lib\site-packages (from torch>=1.4.0->accelerate) (4.4.0)

C:\Users\evil\Desktop\Work\stablediffusion\stable-diffusion-webui>

Steps to reproduce the problem

did a git pull today..

C:\Users\evil\Desktop\Work\stablediffusion\stable-diffusion-webui>git pull
remote: Enumerating objects: 213, done.
remote: Counting objects: 100% (176/176), done.
remote: Compressing objects: 100% (83/83), done.
remote: Total 213 (delta 119), reused 132 (delta 93), pack-reused 37 eceiving objects:  99% (211/213)
Receiving objects: 100% (213/213), 166.38 KiB | 1.29 MiB/s, done.
Resolving deltas: 100% (122/122), completed with 21 local objects.
From https://github.com/AUTOMATIC1111/stable-diffusion-webui
   98947d1..47a44c7  master     -> origin/master
Updating 98947d1..47a44c7
Fast-forward
 launch.py                                      |   4 +-
 modules/api/api.py                             | 102 +++++++++++++----------
 modules/api/models.py                          |   6 +-
 modules/extensions.py                          |   7 +-
 modules/generation_parameters_copypaste.py     |   1 +
 modules/hypernetworks/hypernetwork.py          |   4 +-
 modules/images.py                              |   2 +-
 modules/img2img.py                             |   4 +-
 modules/processing.py                          | 111 +++++++++++++------------
 modules/script_callbacks.py                    |  35 ++++++++
 modules/scripts.py                             |  69 ++++++++++++++-
 modules/sd_hijack.py                           |   2 +-
 modules/sd_models.py                           |  10 +--
 modules/sd_samplers.py                         |  13 ++-
 modules/sd_vae.py                              |  36 ++++----
 modules/shared.py                              |  23 ++++-
 modules/styles.py                              |  11 ---
 modules/textual_inversion/textual_inversion.py |   4 +-
 modules/textual_inversion/ui.py                |   2 +-
 modules/txt2img.py                             |   3 +-
 modules/ui.py                                  |  49 ++++++-----
 modules/ui_extensions.py                       |   4 +-
 requirements.txt                               |   1 +
 requirements_versions.txt                      |   1 +
 scripts/img2imgalt.py                          |   4 +-
 scripts/xy_grid.py                             |  12 +--
 webui-user.sh                                  |   3 +
 webui.bat                                      |  12 +++
 webui.py                                       |   6 +-
 webui.sh                                       |  16 +++-
 30 files changed, 366 insertions(+), 191 deletions(-)

C:\Users\evil\Desktop\Work\stablediffusion\stable-diffusion-webui>pip install -r requirements.txt

I noticed that requirements where updated so I ran the pip to install that.. and the error happed with accelerate when trying to run the app.. thoughts?

What should have happened?

ideally the app would of launched w/o a problem.

Commit where the problem happens

47a44c7

What platforms do you use to access UI ?

Windows

What browsers do you use to access the UI ?

No response

Command Line Arguments

just running webui-user.bat with the latest gitpull as of nov 19th.

Additional information, context and logs

No response

gateway avatar Nov 20 '22 05:11 gateway

as a temp fix for me I reverted back to right before accelerate was added.. commit id f37cce0

gateway avatar Nov 20 '22 05:11 gateway

Please check that you have your venv activated:

  • .\venv\Scripts\activate.ps1 for PowerShell
  • .\venv\Scripts\activate.bat for CMD
  • source venv/Scripts/activate for Linux shells

Then try installing it again with pip install accelerate

Hope it helps

Stax124 avatar Dec 10 '22 15:12 Stax124

found venv in stable diffusion, could not find it for comfyUI, installing it for SD did not change a thing in comfyUI

serget2 avatar Apr 03 '24 12:04 serget2

Fixed it with -pip install accelerate But then other errors start appear also fixed it with "-pip install" comand just adding the name of error mostly it was not installed modules.

Leshiy1 avatar Jul 21 '24 20:07 Leshiy1