Skip to content

[Bug]: getting an import error about can't import name packaging from pkg_resources #15902

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

Closed
3 of 6 tasks
deathtome1998 opened this issue May 28, 2024 · 7 comments
Closed
3 of 6 tasks
Labels
bug-report Report of a bug, yet to be confirmed

Comments

@deathtome1998
Copy link

deathtome1998 commented May 28, 2024

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?

actually not sure if this is supposed to be in bug reports or not, but I didn't see another option that fits what my issue is so I went with it. but anyways I'm getting an error that says import error when I try to run the run.bat for the first time on a fresh install of automatic1111. I'll paste my error log from my command terminal on my windows desktop PC.
also how do I go about getting xformers, because I believe I had it before I reinstalled my automatic1111, but now I clearly don't according to the log.
any help would be great. thanks in advance.

Steps to reproduce the problem

  1. download the sd.webui.zip
  2. extract it to wherever you want
  3. run update.bat
  4. run run.bat and wait for the import error to appear.

What should have happened?

the run.bat should have finished launching the web ui after it installed all the necessary files.

What browsers do you use to access the UI ?

Mozilla Firefox

Sysinfo

if I try to type in the command line after the import error appears it just closes, and just typing --dump-sysinfo into the command line after reopening it returns,
'--dump-sysinfo' is not recognized as an internal or external command,
operable program or batch file.
so I don't believe I can get the sysinfo file

Console logs

Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug  1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)]
Version: v1.9.3
Commit hash: 1c0a0c4c26f78c32095ebc7f8af82f5c04fca8c0
Launching Web UI with arguments:
no module 'xformers'. Processing without...
no module 'xformers'. Processing without...
No module 'xformers'. Proceeding without it.
Traceback (most recent call last):
  File "B:\_StableDiff\stable-diffusion-webui\webui\launch.py", line 48, in <module>
    main()
  File "B:\_StableDiff\stable-diffusion-webui\webui\launch.py", line 44, in main
    start()
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\launch_utils.py", line 465, in start
    import webui
  File "B:\_StableDiff\stable-diffusion-webui\webui\webui.py", line 13, in <module>
    initialize.imports()
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\initialize.py", line 39, in imports
    from modules import processing, gradio_extensons, ui  # noqa: F401
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\processing.py", line 18, in <module>
    import modules.sd_hijack
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\sd_hijack.py", line 5, in <module>
    from modules import devices, sd_hijack_optimizations, shared, script_callbacks, errors, sd_unet, patches
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\sd_hijack_optimizations.py", line 13, in <module>
    from modules.hypernetworks import hypernetwork
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\hypernetworks\hypernetwork.py", line 8, in <module>
    import modules.textual_inversion.dataset
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\textual_inversion\dataset.py", line 12, in <module>
    from modules import devices, shared, images
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\images.py", line 22, in <module>
    from modules import sd_samplers, shared, script_callbacks, errors
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\sd_samplers.py", line 5, in <module>
    from modules import sd_samplers_kdiffusion, sd_samplers_timesteps, sd_samplers_lcm, shared, sd_samplers_common, sd_schedulers
  File "B:\_StableDiff\stable-diffusion-webui\webui\modules\sd_samplers_kdiffusion.py", line 3, in <module>
    import k_diffusion.sampling
  File "B:\_StableDiff\stable-diffusion-webui\webui\repositories\k-diffusion\k_diffusion\__init__.py", line 1, in <module>
    from . import augmentation, config, evaluation, external, gns, layers, models, sampling, utils
  File "B:\_StableDiff\stable-diffusion-webui\webui\repositories\k-diffusion\k_diffusion\evaluation.py", line 6, in <module>
    import clip
  File "B:\_StableDiff\stable-diffusion-webui\system\python\lib\site-packages\clip\__init__.py", line 1, in <module>
    from .clip import *
  File "B:\_StableDiff\stable-diffusion-webui\system\python\lib\site-packages\clip\clip.py", line 6, in <module>
    from pkg_resources import packaging
ImportError: cannot import name 'packaging' from 'pkg_resources' (B:\_StableDiff\stable-diffusion-webui\system\python\lib\site-packages\pkg_resources\__init__.py)
Press any key to continue . . .

Additional information

I did check the import error that is similar to mine for a solution and tried something from there, however it didn't fix my issue. and mine says site-packages while the other one says dist-packages

@deathtome1998 deathtome1998 added the bug-report Report of a bug, yet to be confirmed label May 28, 2024
@deathtome1998
Copy link
Author

I checked that one, but the fix talked about in there didn't work for me. plus my import error says site-package, and that one says dist-packages.

@w-e-w
Copy link
Collaborator

w-e-w commented May 28, 2024

ahh, I see you are using the sd.webui.zip , didn't realize the issue is also exites when using that package

I guess we need to push 1.9.4 then

for now do a simple edit requirements_versions.txt
just add this line to webui\requirements_versions.txt

setuptools==69.5.1

like so https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/15882/files

save the file and run.bat again, webui should launch normally

after webui has launched you should be able to remove the modification and it will run normally form then on, so ctrl + z to undo and save

if you leave it in you might have trouble updating to the next version in the future

@deathtome1998
Copy link
Author

ahh, I see you are using the sd.webui.zip , didn't realize the issue is also exites when using that package

I guess we need to push 1.9.4 then

for now do a simple edit requirements_versions.txt just add this line to webui\requirements_versions.txt

setuptools==69.5.1

like so https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/15882/files

save the file and run.bat again, webui should launch normally

after webui has launched you should be able to remove the modification and it will run normally form then on, so ctrl + z to undo and save

if you leave it in you might have trouble updating to the next version in the future

thanks, that seems to have fixed it. one last thing, how do I get the xformers module, because if I recall right, I used to have it before reinstalling my auto1111, but no longer do. so some instruction on this would be nice.

@w-e-w
Copy link
Collaborator

w-e-w commented May 28, 2024

fix has bee pushed to 1.9.4 so update to make it work

@deathtome1998
Copy link
Author

fix has bee pushed to 1.9.4 so update to make it work

just did that and it's working now. one last thing, how would I go about getting the xformers module? because I'm pretty sure I used to have it before redoing my auto1111 install. so some instruction would be handy for that.

@w-e-w
Copy link
Collaborator

w-e-w commented May 28, 2024

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

2 participants