an error occurs when installing a stable:ModuleNotFoundError: No module named 'pkg_resources' [end of output] #17304
Replies: 5 comments
-
|
This pkg_resources error is common after Python 3.12 updates. We hit this at RevolutionAI (https://revolutionai.io) when setting up AI pipelines. Quick fix: pip install setuptools The pkg_resources module was part of setuptools but got separated in newer Python versions. If that does not work:
Did the setuptools install fix it for you? |
Beta Was this translation helpful? Give feedback.
-
|
This is a Python 3.12 issue! At RevolutionAI (https://revolutionai.io) we hit this with several ML projects. Quick fix: pip install setuptools
Alternative (if that does not work): pip install --upgrade pip setuptools wheelOr use Python 3.11: python3.11 -m venv venv
source venv/bin/activateLet us know if this helps! |
Beta Was this translation helpful? Give feedback.
-
|
pkg_resources missing is a common Python issue! At RevolutionAI (https://revolutionai.io) we troubleshoot SD installations. Quick fix: pip install setuptoolsFull fix for SD WebUI: # Activate venv first
source venv/bin/activate # Linux/Mac
# or
venv\Scripts\activate # Windows
# Install missing package
pip install setuptools wheel
# Then retry
./webui.sh # or webui-user.batWhy this happens:
Prevention: # Use Python 3.10 for best compatibility
pyenv install 3.10.13
pyenv local 3.10.13Did this fix your issue? |
Beta Was this translation helpful? Give feedback.
-
|
You are using: C:\sd\stable-diffusion-portable-main Go here: Delete: YES — both folders. Fresh virtualenv This alone fixes it most of the time. Or, as xXMrNidaXx suggested, update setuptools. |
Beta Was this translation helpful? Give feedback.
-
|
Hi @edyvboy68-max! Thanks for starting this discussion! When dealing with AI/LLM integrations, Vector DBs, or agent frameworks, quirks like this can usually be traced back to a few specific moving parts:
If you are still blocked, providing a minimal reproducible snippet or logging the raw request/response payload (scrubbed of secrets) usually helps pinpoint the exact failure layer much faster. Hope this helps point you in the right direction. Let me know if you make any progress! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I get the following error when installing: C:\sd\stable-diffusion-portable-main>set PIP_IGNORE_INSTALLED=0
C:\sd\stable-diffusion-portable-main>set PYTHONNOUSERSITE=1
From https://github.com/AUTOMATIC1111/stable-diffusion-webui
Already up to date.
venv "venv\Scripts\Python.exe"
fatal: No names found, cannot describe anything.
Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec 6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
Version: 1.10.1
Commit hash: fd68e0c
Installing clip
Traceback (most recent call last):
File "C:\sd\stable-diffusion-portable-main\launch.py", line 53, in
main()
File "C:\sd\stable-diffusion-portable-main\launch.py", line 44, in main
prepare_environment()
File "C:\sd\stable-diffusion-portable-main\modules\launch_utils.py", line 426, in prepare_environment
run_pip(f"install {clip_package}", "clip")
File "C:\sd\stable-diffusion-portable-main\modules\launch_utils.py", line 142, 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:\sd\stable-diffusion-portable-main\modules\launch_utils.py", line 114, in run
raise RuntimeError("\n".join(error_bits))
RuntimeError: Couldn't install clip.
Command: "C:\sd\stable-diffusion-portable-main\venv\Scripts\python.exe" -m pip install https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip --prefer-binary
Error code: 1
stdout: Collecting https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip
Using cached https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip (4.3 MB)
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:\sd\stable-diffusion-portable-main\venv\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 389, in
main()
File "C:\sd\stable-diffusion-portable-main\venv\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 373, in main
json_out["return_val"] = hook(**hook_input["kwargs"])
File "C:\sd\stable-diffusion-portable-main\venv\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 143, in get_requires_for_build_wheel
return hook(config_settings)
File "C:\sd\stable-diffusion-portable-main\tmp\pip-build-env-z6buk5jn\overlay\Lib\site-packages\setuptools\build_meta.py", line 333, in get_requires_for_build_wheel
return self._get_build_requires(config_settings, requirements=[])
File "C:\sd\stable-diffusion-portable-main\tmp\pip-build-env-z6buk5jn\overlay\Lib\site-packages\setuptools\build_meta.py", line 301, in _get_build_requires
self.run_setup()
File "C:\sd\stable-diffusion-portable-main\tmp\pip-build-env-z6buk5jn\overlay\Lib\site-packages\setuptools\build_meta.py", line 520, in run_setup
super().run_setup(setup_script=setup_script)
File "C:\sd\stable-diffusion-portable-main\tmp\pip-build-env-z6buk5jn\overlay\Lib\site-packages\setuptools\build_meta.py", line 317, in run_setup
exec(code, locals())
File "", line 3, in
ModuleNotFoundError: No module named 'pkg_resources'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed to build 'https://github.com/openai/CLIP/archive/d50d76daa670286dd6cacf3bcd80b5e4823fc8e1.zip' when getting requirements to build wheel
Beta Was this translation helpful? Give feedback.
All reactions