Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Winodws 11 error - ModuleNotFoundError - No module named 'setuptools.command.test' - build stops #16289

Open
1 of 6 tasks
smuchow1962 opened this issue Jul 29, 2024 · 32 comments
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@smuchow1962
Copy link

Checklist

  • The issue exists after disabling all extensions
  • The issue exists on a clean installation of webui
  • The issue is caused by an extension, but I believe it is caused by a bug in the webui
  • The issue exists in the current version of the webui
  • The issue has not been reported before recently
  • The issue has been reported before but has not been fixed yet

What happened?

Followed the instructions for a build from a git clone in Powershell

got this error

stderr:   error: subprocess-exited-with-error

  Getting requirements to build wheel did not run successfully.
  exit code: 1

  [17 lines of output]
  Traceback (most recent call last):
    File "D:\LLM\stable-diffusion-webui\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "D:\LLM\stable-diffusion-webui\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "D:\LLM\stable-diffusion-webui\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\smuch\AppData\Local\Temp\pip-build-env-i3mg2iw1\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
    File "C:\Users\smuch\AppData\Local\Temp\pip-build-env-i3mg2iw1\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
      self.run_setup()
    File "C:\Users\smuch\AppData\Local\Temp\pip-build-env-i3mg2iw1\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
      super().run_setup(setup_script=setup_script)
    File "C:\Users\smuch\AppData\Local\Temp\pip-build-env-i3mg2iw1\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
      exec(code, locals())
    File "<string>", line 2, in <module>
  ModuleNotFoundError: No module named 'setuptools.command.test'
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully.
exit code: 1

See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Press any key to continue . . .

I also tried it with the zip file installer setup. similar result

stderr:   error: subprocess-exited-with-error

  python setup.py egg_info did not run successfully.
  exit code: 1

  [6 lines of output]
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\smuch\AppData\Local\Temp\pip-install-srpzlrov\ffmpy_db25df8b775d445b9a70509bf2a87e3d\setup.py", line 2, in <module>
      from setuptools.command.test import test as TestCommand  # noqa
  ModuleNotFoundError: No module named 'setuptools.command.test'
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Encountered error while generating package metadata.

See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Steps to reproduce the problem

Installed python 3.10.6
Installed git

ran the instructions as listed - both for the auto installer and the git clone method

on Drive D and not drive c
Also tried it on drive C in C:\bin\sd\sd.webui

all failures

What should have happened?

The installer should have built

What browsers do you use to access the UI ?

No response

Sysinfo

THis is in the installation - haven't even gotten far enbough

Console logs

this is the run.bat version


Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.10.1
Commit hash: 82a973c04367123ae98bd9abdf80d9eda9b910e2
Installing torch and torchvision
Looking in indexes: https://pypi.org/simple, https://download.pytorch.org/whl/cu121
Collecting torch==2.1.2
  Using cached https://download.pytorch.org/whl/cu121/torch-2.1.2%2Bcu121-cp310-cp310-win_amd64.whl (2473.9 MB)
Collecting torchvision==0.16.2
  Using cached https://download.pytorch.org/whl/cu121/torchvision-0.16.2%2Bcu121-cp310-cp310-win_amd64.whl (5.6 MB)
Collecting filelock (from torch==2.1.2)
  Using cached filelock-3.15.4-py3-none-any.whl.metadata (2.9 kB)
Collecting typing-extensions (from torch==2.1.2)
  Using cached typing_extensions-4.12.2-py3-none-any.whl.metadata (3.0 kB)
Collecting sympy (from torch==2.1.2)
  Using cached sympy-1.13.1-py3-none-any.whl.metadata (12 kB)
Collecting networkx (from torch==2.1.2)
  Using cached networkx-3.3-py3-none-any.whl.metadata (5.1 kB)
Collecting jinja2 (from torch==2.1.2)
  Using cached jinja2-3.1.4-py3-none-any.whl.metadata (2.6 kB)
Collecting fsspec (from torch==2.1.2)
  Using cached fsspec-2024.6.1-py3-none-any.whl.metadata (11 kB)
Collecting numpy (from torchvision==0.16.2)
  Using cached numpy-2.0.1-cp310-cp310-win_amd64.whl.metadata (60 kB)
Collecting requests (from torchvision==0.16.2)
  Using cached requests-2.32.3-py3-none-any.whl.metadata (4.6 kB)
Collecting pillow!=8.3.*,>=5.3.0 (from torchvision==0.16.2)
  Using cached pillow-10.4.0-cp310-cp310-win_amd64.whl.metadata (9.3 kB)
Collecting MarkupSafe>=2.0 (from jinja2->torch==2.1.2)
  Using cached https://download.pytorch.org/whl/MarkupSafe-2.1.5-cp310-cp310-win_amd64.whl (17 kB)
Collecting charset-normalizer<4,>=2 (from requests->torchvision==0.16.2)
  Using cached charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl.metadata (34 kB)
Collecting idna<4,>=2.5 (from requests->torchvision==0.16.2)
  Using cached idna-3.7-py3-none-any.whl.metadata (9.9 kB)
Collecting urllib3<3,>=1.21.1 (from requests->torchvision==0.16.2)
  Using cached urllib3-2.2.2-py3-none-any.whl.metadata (6.4 kB)
Collecting certifi>=2017.4.17 (from requests->torchvision==0.16.2)
  Using cached certifi-2024.7.4-py3-none-any.whl.metadata (2.2 kB)
Collecting mpmath<1.4,>=1.1.0 (from sympy->torch==2.1.2)
  Using cached https://download.pytorch.org/whl/mpmath-1.3.0-py3-none-any.whl (536 kB)
Using cached pillow-10.4.0-cp310-cp310-win_amd64.whl (2.6 MB)
Using cached filelock-3.15.4-py3-none-any.whl (16 kB)
Using cached fsspec-2024.6.1-py3-none-any.whl (177 kB)
Using cached jinja2-3.1.4-py3-none-any.whl (133 kB)
Using cached networkx-3.3-py3-none-any.whl (1.7 MB)
Using cached numpy-2.0.1-cp310-cp310-win_amd64.whl (16.6 MB)
Using cached requests-2.32.3-py3-none-any.whl (64 kB)
Using cached sympy-1.13.1-py3-none-any.whl (6.2 MB)
Using cached typing_extensions-4.12.2-py3-none-any.whl (37 kB)
Using cached certifi-2024.7.4-py3-none-any.whl (162 kB)
Using cached charset_normalizer-3.3.2-cp310-cp310-win_amd64.whl (100 kB)
Using cached idna-3.7-py3-none-any.whl (66 kB)
Using cached urllib3-2.2.2-py3-none-any.whl (121 kB)
Installing collected packages: mpmath, urllib3, typing-extensions, sympy, pillow, numpy, networkx, MarkupSafe, idna, fsspec, filelock, charset-normalizer, certifi, requests, jinja2, torch, torchvision
Successfully installed MarkupSafe-2.1.5 certifi-2024.7.4 charset-normalizer-3.3.2 filelock-3.15.4 fsspec-2024.6.1 idna-3.7 jinja2-3.1.4 mpmath-1.3.0 networkx-3.3 numpy-2.0.1 pillow-10.4.0 requests-2.32.3 sympy-1.13.1 torch-2.1.2+cu121 torchvision-0.16.2+cu121 typing-extensions-4.12.2 urllib3-2.2.2
Installing clip
Installing open_clip
Cloning assets into C:\bin\sd\sd.webui\webui\repositories\stable-diffusion-webui-assets...
Cloning into 'C:\bin\sd\sd.webui\webui\repositories\stable-diffusion-webui-assets'...
remote: Enumerating objects: 20, done.
remote: Counting objects: 100% (20/20), done.
remote: Compressing objects: 100% (18/18), done.
Receiving objects: 100% (20/20)sed 20 (delta 0), pack-reused 0
Receiving objects: 100% (20/20), 132.70 KiB | 1.29 MiB/s, done.
Cloning Stable Diffusion into C:\bin\sd\sd.webui\webui\repositories\stable-diffusion-stability-ai...
Cloning into 'C:\bin\sd\sd.webui\webui\repositories\stable-diffusion-stability-ai'...
remote: Enumerating objects: 580, done.
remote: Counting objects: 100% (571/571), done.
remote: Compressing objects: 100% (304/304), done.
remote: Total 580 (delta 278), reused 448 (delta 249), pack-reused 9Receiving objects:  92% (534/580), 55.48 MiB | 36.98 MiB/s
Receiving objects: 100% (580/580), 73.44 MiB | 38.99 MiB/s, done.
Resolving deltas: 100% (278/278), done.
Cloning Stable Diffusion XL into C:\bin\sd\sd.webui\webui\repositories\generative-models...
Cloning into 'C:\bin\sd\sd.webui\webui\repositories\generative-models'...
remote: Enumerating objects: 983, done.
remote: Counting objects: 100% (42/42), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 983 (delta 8), reused 31 (delta 7), pack-reused 941
Receiving objects: 100% (983/983), 52.06 MiB | 40.32 MiB/s, done.
Resolving deltas: 100% (499/499), done.
Cloning K-diffusion into C:\bin\sd\sd.webui\webui\repositories\k-diffusion...
Cloning into 'C:\bin\sd\sd.webui\webui\repositories\k-diffusion'...
remote: Enumerating objects: 1345, done.
remote: Counting objects: 100% (1345/1345), done.
remote: Compressing objects: 100% (443/443), done.
remote: Total 1345 (delta 947), reused 1249 (delta 895), pack-reused 0
Receiving objects: 100% (1345/1345), 232.84 KiB | 2.08 MiB/s, done.
Resolving deltas: 100% (947/947), done.
Cloning BLIP into C:\bin\sd\sd.webui\webui\repositories\BLIP...
Cloning into 'C:\bin\sd\sd.webui\webui\repositories\BLIP'...
remote: Enumerating objects: 277, done.
remote: Counting objects: 100% (165/165), done.
remote: Compressing objects: 100% (30/30), done.
remote: Total 277 (delta 137), reused 136 (delta 135), pack-reused 112
Receiving objects: 100% (277/277), 7.03 MiB | 20.23 MiB/s, done.
Resolving deltas: 100% (152/152), done.
Installing requirements
Traceback (most recent call last):
  File "C:\bin\sd\sd.webui\webui\launch.py", line 48, in <module>
    main()
  File "C:\bin\sd\sd.webui\webui\launch.py", line 39, in main
    prepare_environment()
  File "C:\bin\sd\sd.webui\webui\modules\launch_utils.py", line 423, in prepare_environment
    run_pip(f"install -r \"{requirements_file}\"", "requirements")
  File "C:\bin\sd\sd.webui\webui\modules\launch_utils.py", line 144, in run_pip
    return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)
  File "C:\bin\sd\sd.webui\webui\modules\launch_utils.py", line 116, in run
    raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install requirements.
Command: "C:\bin\sd\sd.webui\system\python\python.exe" -m pip install -r "requirements_versions.txt" --prefer-binary
Error code: 1
stdout: Collecting setuptools==69.5.1 (from -r requirements_versions.txt (line 1))
  Using cached setuptools-69.5.1-py3-none-any.whl.metadata (6.2 kB)
Collecting GitPython==3.1.32 (from -r requirements_versions.txt (line 2))
  Using cached GitPython-3.1.32-py3-none-any.whl.metadata (10.0 kB)
Collecting Pillow==9.5.0 (from -r requirements_versions.txt (line 3))
  Using cached Pillow-9.5.0-cp310-cp310-win_amd64.whl.metadata (9.7 kB)
Collecting accelerate==0.21.0 (from -r requirements_versions.txt (line 4))
  Using cached accelerate-0.21.0-py3-none-any.whl.metadata (17 kB)
Collecting blendmodes==2022 (from -r requirements_versions.txt (line 5))
  Using cached blendmodes-2022-py3-none-any.whl.metadata (12 kB)
Collecting clean-fid==0.1.35 (from -r requirements_versions.txt (line 6))
  Using cached clean_fid-0.1.35-py3-none-any.whl.metadata (36 kB)
Collecting diskcache==5.6.3 (from -r requirements_versions.txt (line 7))
  Using cached diskcache-5.6.3-py3-none-any.whl.metadata (20 kB)
Collecting einops==0.4.1 (from -r requirements_versions.txt (line 8))
  Using cached einops-0.4.1-py3-none-any.whl.metadata (10 kB)
Collecting facexlib==0.3.0 (from -r requirements_versions.txt (line 9))
  Using cached facexlib-0.3.0-py3-none-any.whl.metadata (4.6 kB)
Collecting fastapi==0.94.0 (from -r requirements_versions.txt (line 10))
  Using cached fastapi-0.94.0-py3-none-any.whl.metadata (25 kB)
Collecting gradio==3.41.2 (from -r requirements_versions.txt (line 11))
  Using cached gradio-3.41.2-py3-none-any.whl.metadata (17 kB)
Collecting httpcore==0.15 (from -r requirements_versions.txt (line 12))
  Using cached httpcore-0.15.0-py3-none-any.whl.metadata (15 kB)
Collecting inflection==0.5.1 (from -r requirements_versions.txt (line 13))
  Using cached inflection-0.5.1-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting jsonmerge==1.8.0 (from -r requirements_versions.txt (line 14))
  Using cached jsonmerge-1.8.0.tar.gz (26 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting kornia==0.6.7 (from -r requirements_versions.txt (line 15))
  Using cached kornia-0.6.7-py2.py3-none-any.whl.metadata (12 kB)
Collecting lark==1.1.2 (from -r requirements_versions.txt (line 16))
  Using cached lark-1.1.2-py2.py3-none-any.whl.metadata (1.7 kB)
Collecting numpy==1.26.2 (from -r requirements_versions.txt (line 17))
  Using cached numpy-1.26.2-cp310-cp310-win_amd64.whl.metadata (61 kB)
Collecting omegaconf==2.2.3 (from -r requirements_versions.txt (line 18))
  Using cached omegaconf-2.2.3-py3-none-any.whl.metadata (3.9 kB)
Collecting open-clip-torch==2.20.0 (from -r requirements_versions.txt (line 19))
  Using cached open_clip_torch-2.20.0-py3-none-any.whl.metadata (46 kB)
Collecting piexif==1.1.3 (from -r requirements_versions.txt (line 20))
  Using cached piexif-1.1.3-py2.py3-none-any.whl.metadata (3.7 kB)
Requirement already satisfied: protobuf==3.20.0 in c:\bin\sd\sd.webui\system\python\lib\site-packages (from -r requirements_versions.txt (line 21)) (3.20.0)
Collecting psutil==5.9.5 (from -r requirements_versions.txt (line 22))
  Using cached psutil-5.9.5-cp36-abi3-win_amd64.whl.metadata (21 kB)
Collecting pytorch_lightning==1.9.4 (from -r requirements_versions.txt (line 23))
  Using cached pytorch_lightning-1.9.4-py3-none-any.whl.metadata (22 kB)
Collecting resize-right==0.0.2 (from -r requirements_versions.txt (line 24))
  Using cached resize_right-0.0.2-py3-none-any.whl.metadata (551 bytes)
Collecting safetensors==0.4.2 (from -r requirements_versions.txt (line 25))
  Using cached safetensors-0.4.2-cp310-none-win_amd64.whl.metadata (3.9 kB)
Collecting scikit-image==0.21.0 (from -r requirements_versions.txt (line 26))
  Using cached scikit_image-0.21.0-cp310-cp310-win_amd64.whl.metadata (14 kB)
Collecting spandrel==0.3.4 (from -r requirements_versions.txt (line 27))
  Using cached spandrel-0.3.4-py3-none-any.whl.metadata (14 kB)
Collecting spandrel-extra-arches==0.1.1 (from -r requirements_versions.txt (line 28))
  Using cached spandrel_extra_arches-0.1.1-py3-none-any.whl.metadata (3.0 kB)
Collecting tomesd==0.1.3 (from -r requirements_versions.txt (line 29))
  Using cached tomesd-0.1.3-py3-none-any.whl.metadata (9.1 kB)
Requirement already satisfied: torch in c:\bin\sd\sd.webui\system\python\lib\site-packages (from -r requirements_versions.txt (line 30)) (2.1.2+cu121)
Collecting torchdiffeq==0.2.3 (from -r requirements_versions.txt (line 31))
  Using cached torchdiffeq-0.2.3-py3-none-any.whl.metadata (488 bytes)
Collecting torchsde==0.2.6 (from -r requirements_versions.txt (line 32))
  Using cached torchsde-0.2.6-py3-none-any.whl.metadata (5.3 kB)
Collecting transformers==4.30.2 (from -r requirements_versions.txt (line 33))
  Using cached transformers-4.30.2-py3-none-any.whl.metadata (113 kB)
Collecting httpx==0.24.1 (from -r requirements_versions.txt (line 34))
  Using cached httpx-0.24.1-py3-none-any.whl.metadata (7.4 kB)
Collecting pillow-avif-plugin==1.4.3 (from -r requirements_versions.txt (line 35))
  Using cached pillow_avif_plugin-1.4.3-cp310-cp310-win_amd64.whl.metadata (1.7 kB)
Collecting gitdb<5,>=4.0.1 (from GitPython==3.1.32->-r requirements_versions.txt (line 2))
  Using cached gitdb-4.0.11-py3-none-any.whl.metadata (1.2 kB)
Requirement already satisfied: packaging>=20.0 in c:\bin\sd\sd.webui\system\python\lib\site-packages (from accelerate==0.21.0->-r requirements_versions.txt (line 4)) (24.1)
Requirement already satisfied: pyyaml in c:\bin\sd\sd.webui\system\python\lib\site-packages (from accelerate==0.21.0->-r requirements_versions.txt (line 4)) (6.0.1)
Collecting aenum<4,>=3.1.7 (from blendmodes==2022->-r requirements_versions.txt (line 5))
  Using cached aenum-3.1.15-py3-none-any.whl.metadata (3.7 kB)
Collecting deprecation<3,>=2.1.0 (from blendmodes==2022->-r requirements_versions.txt (line 5))
  Using cached deprecation-2.1.0-py2.py3-none-any.whl.metadata (4.6 kB)
Requirement already satisfied: torchvision in c:\bin\sd\sd.webui\system\python\lib\site-packages (from clean-fid==0.1.35->-r requirements_versions.txt (line 6)) (0.16.2+cu121)
Collecting scipy>=1.0.1 (from clean-fid==0.1.35->-r requirements_versions.txt (line 6))
  Using cached scipy-1.14.0-cp310-cp310-win_amd64.whl.metadata (60 kB)
Requirement already satisfied: tqdm>=4.28.1 in c:\bin\sd\sd.webui\system\python\lib\site-packages (from clean-fid==0.1.35->-r requirements_versions.txt (line 6)) (4.66.4)
Requirement already satisfied: requests in c:\bin\sd\sd.webui\system\python\lib\site-packages (from clean-fid==0.1.35->-r requirements_versions.txt (line 6)) (2.32.3)
Collecting filterpy (from facexlib==0.3.0->-r requirements_versions.txt (line 9))
  Using cached filterpy-1.4.5-py3-none-any.whl
Collecting numba (from facexlib==0.3.0->-r requirements_versions.txt (line 9))
  Using cached numba-0.60.0-cp310-cp310-win_amd64.whl.metadata (2.8 kB)
Collecting opencv-python (from facexlib==0.3.0->-r requirements_versions.txt (line 9))
  Using cached opencv_python-4.10.0.84-cp37-abi3-win_amd64.whl.metadata (20 kB)
Collecting pydantic!=1.7,!=1.7.1,!=1.7.2,!=1.7.3,!=1.8,!=1.8.1,<2.0.0,>=1.6.2 (from fastapi==0.94.0->-r requirements_versions.txt (line 10))
  Using cached pydantic-1.10.17-cp310-cp310-win_amd64.whl.metadata (153 kB)
Collecting starlette<0.27.0,>=0.26.0 (from fastapi==0.94.0->-r requirements_versions.txt (line 10))
  Using cached starlette-0.26.1-py3-none-any.whl.metadata (5.8 kB)
Collecting aiofiles<24.0,>=22.0 (from gradio==3.41.2->-r requirements_versions.txt (line 11))
  Using cached aiofiles-23.2.1-py3-none-any.whl.metadata (9.7 kB)
Collecting altair<6.0,>=4.2.0 (from gradio==3.41.2->-r requirements_versions.txt (line 11))
  Using cached altair-5.3.0-py3-none-any.whl.metadata (9.2 kB)
Collecting ffmpy (from gradio==3.41.2->-r requirements_versions.txt (line 11))
  Using cached ffmpy-0.3.2.tar.gz (5.5 kB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'

stderr:   error: subprocess-exited-with-error

  python setup.py egg_info did not run successfully.
  exit code: 1

  [6 lines of output]
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:\Users\smuch\AppData\Local\Temp\pip-install-ykhnx1ee\ffmpy_d3c3baef266048a9b4928174b12ae2e9\setup.py", line 2, in <module>
      from setuptools.command.test import test as TestCommand  # noqa
  ModuleNotFoundError: No module named 'setuptools.command.test'
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

Encountered error while generating package metadata.

See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

Press any key to continue . . .

Additional information

No response

@smuchow1962 smuchow1962 added the bug-report Report of a bug, yet to be confirmed label Jul 29, 2024
@shinkawk
Copy link

shinkawk commented Jul 29, 2024

Hi @smuchow1962

Just run into the same issue this morning for a completely irrelevant project.

Looks like setuptools just had 72.0,0 update 3 hours ago and that's the cause of this issue. https://pypi.org/project/setuptools/#history

Because we cannot "set up" setuptools' version on Pipfile directly, we made the following workaround

python -m pip install --upgrade pip
pip install pipenv
pipenv install "setuptools==71.1.0"  <= Insert this before running your installation
 pipenv sync --system --dev

Hope this helps!

@pjeugster
Copy link

I'm trying to install this as well for the first time and am seeing the same error. I tried the workaround above but got an error on the final step

C:\Users\peter>pipenv sync --system --dev Installing dependencies from Pipfile.lock (54289e)... [pipenv.exceptions.InstallError]: Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. ERROR: Couldn't install package: {} Package installation failed...

@EuDs63
Copy link

EuDs63 commented Jul 29, 2024

This bug arises from changes made to setuptools.command.test in the 72.0.0 update of setuptools. For more details, refer to the setuptools · PyPI page. One of the dependencies used in this repository, Ch00k/ffmpy: Pythonic interface for FFmpeg/FFprobe command line, utilizes setuptools.command.test.

As a temporary solution, I forked the project and removed the relevant code to ensure it runs smoothly. You can use the following command to install the modified version:

pip install git+https://github.com/EuDs63/ffmpy.git

@2tqdtm
Copy link

2tqdtm commented Jul 29, 2024

pip install git+https://github.com/EuDs63/ffmpy.git

thanks for the solution, I tried, but the installation also fails, what am I doing wrong?

PS X:\SD> pip install git+https://github.com/EuDs63/ffmpy.git
Collecting git+https://github.com/EuDs63/ffmpy.git
  Cloning https://github.com/EuDs63/ffmpy.git to c:\users\wmcasher\appdata\local\temp\pip-req-build-w_hiy1k0
  Running command git clone --filter=blob:none --quiet https://github.com/EuDs63/ffmpy.git 'C:\Users\wmcasher\AppData\Local\Temp\pip-req-build-w_hiy1k0'
  Resolved https://github.com/EuDs63/ffmpy.git to commit 333a19ee4d21f32537c0508aa1942ef1aa7afe24
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: ffmpy
  Building wheel for ffmpy (pyproject.toml) ... done
  Created wheel for ffmpy: filename=ffmpy-0.3.2-py3-none-any.whl size=5631 sha256=5a1df43a40284565d7194fc6b7b069faabce2e3646eaf720418457b2003faf81
  Stored in directory: C:\Users\wmcasher\AppData\Local\Temp\pip-ephem-wheel-cache-0ie24xsa\wheels\7d\30\a2\8f22d636585c2b8bbaa97a88138880684f28dee8bd797a72ea
Successfully built ffmpy
Installing collected packages: ffmpy
Successfully installed ffmpy-0.3.2

.........
Collecting ffmpy (from gradio==3.41.2->-r requirements_versions.txt (line 11))
  Downloading ffmpy-0.3.2.tar.gz (5.5 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'

stderr:   error: subprocess-exited-with-error

  Getting requirements to build wheel did not run successfully.
  exit code: 1

  [17 lines of output]
  Traceback (most recent call last):
    File "X:\SD\stable-diffusion-webui\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "X:\SD\stable-diffusion-webui\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "X:\SD\stable-diffusion-webui\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\wmcasher\AppData\Local\Temp\pip-build-env-ea5fbar8\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
    File "C:\Users\wmcasher\AppData\Local\Temp\pip-build-env-ea5fbar8\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
      self.run_setup()
    File "C:\Users\wmcasher\AppData\Local\Temp\pip-build-env-ea5fbar8\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
      super().run_setup(setup_script=setup_script)
    File "C:\Users\wmcasher\AppData\Local\Temp\pip-build-env-ea5fbar8\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
      exec(code, locals())
    File "<string>", line 2, in <module>
  ModuleNotFoundError: No module named 'setuptools.command.test'
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully.
exit code: 1

See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

@AdityaMathur
Copy link

Hey did you find any solution, I am facing the same issue

@EuDs63
Copy link

EuDs63 commented Jul 29, 2024

pip install git+https://github.com/EuDs63/ffmpy.git

thanks for the solution, I tried, but the installation also fails, what am I doing wrong?

PS X:\SD> pip install git+https://github.com/EuDs63/ffmpy.git
Collecting git+https://github.com/EuDs63/ffmpy.git
  Cloning https://github.com/EuDs63/ffmpy.git to c:\users\wmcasher\appdata\local\temp\pip-req-build-w_hiy1k0
  Running command git clone --filter=blob:none --quiet https://github.com/EuDs63/ffmpy.git 'C:\Users\wmcasher\AppData\Local\Temp\pip-req-build-w_hiy1k0'
  Resolved https://github.com/EuDs63/ffmpy.git to commit 333a19ee4d21f32537c0508aa1942ef1aa7afe24
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: ffmpy
  Building wheel for ffmpy (pyproject.toml) ... done
  Created wheel for ffmpy: filename=ffmpy-0.3.2-py3-none-any.whl size=5631 sha256=5a1df43a40284565d7194fc6b7b069faabce2e3646eaf720418457b2003faf81
  Stored in directory: C:\Users\wmcasher\AppData\Local\Temp\pip-ephem-wheel-cache-0ie24xsa\wheels\7d\30\a2\8f22d636585c2b8bbaa97a88138880684f28dee8bd797a72ea
Successfully built ffmpy
Installing collected packages: ffmpy
Successfully installed ffmpy-0.3.2
.........
Collecting ffmpy (from gradio==3.41.2->-r requirements_versions.txt (line 11))
  Downloading ffmpy-0.3.2.tar.gz (5.5 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'error'

stderr:   error: subprocess-exited-with-error

  Getting requirements to build wheel did not run successfully.
  exit code: 1

  [17 lines of output]
  Traceback (most recent call last):
    File "X:\SD\stable-diffusion-webui\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
      main()
    File "X:\SD\stable-diffusion-webui\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
    File "X:\SD\stable-diffusion-webui\venv\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
      return hook(config_settings)
    File "C:\Users\wmcasher\AppData\Local\Temp\pip-build-env-ea5fbar8\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
      return self._get_build_requires(config_settings, requirements=[])
    File "C:\Users\wmcasher\AppData\Local\Temp\pip-build-env-ea5fbar8\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
      self.run_setup()
    File "C:\Users\wmcasher\AppData\Local\Temp\pip-build-env-ea5fbar8\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
      super().run_setup(setup_script=setup_script)
    File "C:\Users\wmcasher\AppData\Local\Temp\pip-build-env-ea5fbar8\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
      exec(code, locals())
    File "<string>", line 2, in <module>
  ModuleNotFoundError: No module named 'setuptools.command.test'
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully.
exit code: 1

See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

you should entering venv environment and then pip install git+https://github.com/EuDs63/ffmpy.git

@ericmuijsvanoord
Copy link

ericmuijsvanoord commented Jul 29, 2024

The issue for me was that pip install also updated setuptools. So setting setuptools to an older version helped, but I needed to force pip to not upgrade setuptools, using the no deps flag. Example:
pip install --no-deps pipenv

After that I did the usual pipenv install, but your env might be different.

@on-d-mand
Copy link

I think this can be marked as an "any OS" error.. I've got the same issue on MacOs sanoma (ARM)

@wangchen415
Copy link

setuptools.command.test was removed on 28 Jul 2024: https://setuptools.pypa.io/en/stable/history.html#v72-0-0pip

@AdityaMathur
Copy link

Just looked at their repo here https://setuptools.pypa.io/en/stable/history.html#v72-0-0pip it looks like they have removed support for setuptools.command.test.

@RubTalha
Copy link

https://stackoverflow.com/a/78806669/26556668

@2tqdtm
Copy link

2tqdtm commented Jul 29, 2024

you should entering venv environment and then pip install git+https://github.com/EuDs63/ffmpy.git

Thank you so much, my friend! Everything works great!

@aDashi001
Copy link

you should entering venv environment and then pip install git+https://github.com/EuDs63/ffmpy.git

Thank you so much, my friend! Everything works great!

How did you "enter the venv environment" and where/how did you execute pip install git+https://github.com/EuDs63/ffmpy.git.

@w-e-w
Copy link
Collaborator

w-e-w commented Jul 29, 2024

I'm very perplexed on how this issue can happen
from what I read here the issue seems to be caused by an update to setuptools 72.0.0
but the thing is we specifically specified setuptools==69.5.1 for webui

@ericmuijsvanoord
Copy link

@w-e-w : somehow pip automatically updated setuptools, and overwrites the version already available. That happened to me at least by just doing pip install pipenv.

@w-e-w
Copy link
Collaborator

w-e-w commented Jul 29, 2024

why are you using pipenv? we don't use it by default
are all of you having this issues using pipenv?

@ericmuijsvanoord
Copy link

@w-e-w : I think it is not related to pipenv. I just think that installing a package with setuptool? dependencies will trigger the update to the newest version

@Vasto525i
Copy link

I'm using Pinokio and getting the same error as above.

@flight505
Copy link

How did you "enter the venv environment" and where/how did you execute pip install git+https://github.com/EuDs63/ffmpy.git.

from stable-diffusion-webui/ type source venv/bin/activate
the project has a venv folder within the project.

@w-e-w
Copy link
Collaborator

w-e-w commented Jul 29, 2024

another dev was able to reproduce the issue but I'm still not able to reproduce it on mine I have no idea

a very strange feeling
usually you're glad when things work
but when you're trying to deliberately break it and found that you couldn't that you couldn't

@aDashi001
Copy link

aDashi001 commented Jul 29, 2024

another dev was able to reproduce the issue but I'm still not able to reproduce it on mine I have no idea

a very strange feeling usually you're glad when things work but when you're trying to deliberately break it and found that you couldn't that you couldn't

If it helps?

First Error thrown at me:
Installing requirements
Traceback (most recent call last):
File "C:\AIGen\stable-diffusion-webui\launch.py", line 48, in
main()
File "C:\AIGen\stable-diffusion-webui\launch.py", line 39, in main
prepare_environment()
File "C:\AIGen\stable-diffusion-webui\modules\launch_utils.py", line 423, in prepare_environment
run_pip(f"install -r "{requirements_file}"", "requirements")
File "C:\AIGen\stable-diffusion-webui\modules\launch_utils.py", line 144, in run_pip
return run(f'"{python}" -m pip {command} --prefer-binary{index_url_line}', desc=f"Installing {desc}", errdesc=f"Couldn't install {desc}", live=live)
File "C:\AIGen\stable-diffusion-webui\modules\launch_utils.py", line 116, in run
raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install requirements.
Command: "C:\AIGen\stable-diffusion-webui\venv\Scripts\python.exe" -m pip install -r "requirements_versions.txt" --prefer-binary
Error code: 1

Second Error:
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'error'

stderr: error: subprocess-exited-with-error

Getting requirements to build wheel did not run successfully.
exit code: 1

[17 lines of output]
Traceback (most recent call last):
File "C:\AIGen\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in
main()
File "C:\AIGen\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "C:\AIGen\stable-diffusion-webui\venv\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-zwatdy69\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-zwatdy69\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
self.run_setup()
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-zwatdy69\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\Users\Administrator\AppData\Local\Temp\pip-build-env-zwatdy69\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
exec(code, locals())
File "", line 2, in
ModuleNotFoundError: No module named 'setuptools.command.test'
[end of output]

@LunaticBlue378
Copy link

LunaticBlue378 commented Jul 29, 2024

@flight505 sorry to bother you.
I am New to this kind of program and phython.
I couldn't find 'source venv/bin/activate' at my stable-diffusion-webui folder.
What I only see is 'venv' folder that contains 'Include, Lib, Scripts, share, pyvenv.cfg'
Am I doing correct or do i need to do another thing?

  • i found what you mean. and also found activate.bat file. But it doesn't seem work. when i double click it. it pops up for 0.1 sec and turn off...

@BigWise7
Copy link

BigWise7 commented Jul 29, 2024

@flight505 sorry to bother you. I am New to this kind of program and phython. I couldn't find 'source venv/bin/activate' at my stable-diffusion-webui folder. What I only see is 'venv' folder that contains 'Include, Lib, Scripts, share, pyvenv.cfg' Am I doing correct or do i need to do another thing?

  • i found what you mean. and also found activate.bat file. But it doesn't seem work. when i double click it. it pops up for 0.1 sec and turn off...

You need to be in the CMD window inside that /venv/Scripts folder, then type "activate"
Then you can issue that command and it should install "ffmpy"
After that, you can run webui-user.bat and it should continue with the installation

automatic1111

@2tts
Copy link

2tts commented Jul 29, 2024

@LunaticBlue378
Steps that did it for me:

  1. open a cmd (not python), in your stable diffusion folder/venv/scripts
  2. paste "pip install git+https://github.com/EuDs63/ffmpy.git"

Tip: Open the folder in file explorer and just type cmd in the folder path-bar to open cmd in the current folder
image
image
Hit Enter
image

@aDashi001
Copy link

Not sure what happened, but everything magically began to work again!

@LunaticBlue378
Copy link

@2tts @BigWise7 It works!!!
Really appreciate about your kindness.
Very detailed instruction for Newbie

@Haoming02
Copy link
Contributor

I was fighting this issue yesterday as well...

I found that if I do a fresh git clone, and comment out this line first, then everything installs fine.

ie. Old version of pip (22 in my case) instead of the latest version (24 as of now) works

@w-e-w
Copy link
Collaborator

w-e-w commented Jul 31, 2024

@MarcusNyne
acording to Haoming02 the pip update might be causeing issues

@MarcusNyne
Copy link
Contributor

@Haoming02, thank you for bringing this to my attention. I was camping last week but am back now and investigating the issue.

The line you are commenting out is from one of my commits. I was unable to reproduce the problem locally. I tried:

  • Creating a brand new venv and upgrading pip to 24: setuptools was NOT upgraded
  • Clearing pip cache, then again performing upgrading pip: setuptools was NOT upgraded
  • Running webui-user.bat from a clean git clone: pip was upgraded to 24 but setuptools was NOT upgraded

Given that this behavior is not reproducible, I wonder if the upgraded setuptools pre-dates the pip upgrade. Can you do a pip list in your global environment and see if it has the newer setuptools?

Can you reproduce my steps?

  • python -m venv venv
  • venv\Scripts\pip list
  • venv\Scripts\python -m pip install --upgrade pip
  • venv\Scripts\pip list

Please let me know if you are able to reproduce this. I would be very interested, either way. Thank you!

These are my results:
pip-test

@Haoming02
Copy link
Contributor

I did a pip list in my global space, and found that I did indeed have setuptools installed (forgot to write down the version, but iirc it was 60 something as well). So I did a pip uninstall setuptools in my global space first.

Then I did a clean git clone of the repo, then run webui-user.bat to install. This time, the Webui installed correctly, with pip also upgraded to 24.2. (Though the version of setuptools it installed is 69.5.1)

TL;DR

  • It was probably somehow messed up by the package in the global space?
  • Another thing is I'm using Python 3.10.10 instead of 3.10.6. Could this 4 minor patches cause it to install the incorrect versions?

@Haoming02
Copy link
Contributor

Welp, I cannot repro it myself now either...

@MarcusNyne
Copy link
Contributor

@Haoming02 , thank you for your quick response! Perhaps for selfish reasons, I have been focusing on understanding if the pip upgrade was the source of the problem. I am a new contributor and would feel terrible if a code change I introduced created problems for the community.

Given that this is difficult to reproduce, I think its inconclusive when considering the impact of the upgrade code change on this problem. In other words, it is possible that the problem with the new version of setuptools would have been a problem even under pip 22. I am only speculating. It is possible that the version of setuptools that was installed was a result of virtual environment creation, and not the pip upgrade. I really have no idea.

Do you have any suspicions or thoughts about this based on your experience?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-report Report of a bug, yet to be confirmed
Projects
None yet
Development

No branches or pull requests