Haidra-Org / AI-Horde-Worker

This repo turns your PC into a AI Horde worker node
GNU Affero General Public License v3.0
242 stars 67 forks source link

ImportError: cannot import name 'packaging' from 'pkg_resources' #322

Closed Pup-In-Cup closed 2 months ago

Pup-In-Cup commented 2 months ago

I used to have a working horde client, several updates ago. Then, I installed an update, and it broke. I gave up.

I tried to install the Hode worker again! This time, thinking, "it's been several updates from then; maybe now it'll work..." Nope.

Below is how it broke. All I did was run "horde-bridge" from the Windows command prompt. That is, after I tried to run the batch file from the File Explorer. I am not skilled enough with Python to understand the error. It's way too much beyond me. I'm a very simple person.

I read that the newest version iof "setuptools" is broken. So, I reinstalled the old setuptools. I get the same error message (which is the message I get with the older version anyway).

What can I do to rectify this?

G:\Hail_Haidra\AI-Horde-Worker\conda
warning  libmamba Hook installed, now 'manually' execute:
warning  libmamba        CALL "G:\\Hail_Haidra\\AI-Horde-Worker\\conda\\condabin\\mamba_hook.bat"
2024-06-28 16:29:18.630 | DEBUG    | hordelib.initialisation:initialise:50 - Clearing command line args in sys.argv before ComfyUI load
A matching Triton is not available, some optimizations will not be enabled.
Error caught was: No module named 'triton'
xformers version: 0.0.20
Using device: CUDA 0: NVIDIA GeForce RTX 4060 Ti
Using xformers cross attention
xformers version: 0.0.20
Using device: CUDA 0: NVIDIA GeForce RTX 4060 Ti
Traceback (most recent call last):
  File "G:\Hail_Haidra\AI-Horde-Worker\bridge_stable_diffusion.py", line 14, in <module>
    hordelib.initialise()
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\initialisation.py", line 61, in initialise
    hordelib.comfy_horde.do_comfy_import()
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\comfy_horde.py", line 107, in do_comfy_import
    from hordelib.nodes.comfy_controlnet_preprocessors import (
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\__init__.py", line 1, in <module>
    from . import canny, hed, midas, mlsd, openpose, uniformer, leres, mp_pose_hand, color, binary, pidinet, mp_face_mesh
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\__init__.py", line 3, in <module>
    from comfy_controlnet_preprocessors.uniformer.mmseg.apis import init_segmentor, inference_segmentor, show_result_pyplot
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\__init__.py", line 1, in <module>
    from . import canny, hed, midas, mlsd, openpose, uniformer, leres, mp_pose_hand, color, binary, pidinet, mp_face_mesh
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\__init__.py", line 3, in <module>
    from comfy_controlnet_preprocessors.uniformer.mmseg.apis import init_segmentor, inference_segmentor, show_result_pyplot
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\mmseg\apis\__init__.py", line 1, in <module>
    from .inference import inference_segmentor, init_segmentor, show_result_pyplot
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\mmseg\apis\inference.py", line 1, in <module>
    import comfy_controlnet_preprocessors.uniformer.mmcv as mmcv
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\mmcv\__init__.py", line 4, in <module>
    from .fileio import *
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\mmcv\fileio\__init__.py", line 2, in <module>
    from .file_client import BaseStorageBackend, FileClient
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\mmcv\fileio\file_client.py", line 15, in <module>
    from comfy_controlnet_preprocessors.uniformer.mmcv.utils.misc import has_method
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\mmcv\utils\__init__.py", line 39, in <module>
    from .env import collect_env
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\mmcv\utils\env.py", line 13, in <module>
    from .parrots_wrapper import get_build_config
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\mmcv\utils\parrots_wrapper.py", line 94, in <module>
    BuildExtension, CppExtension, CUDAExtension = _get_extension()
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\hordelib\nodes\comfy_controlnet_preprocessors\uniformer\mmcv\utils\parrots_wrapper.py", line 64, in _get_extension
    from torch.utils.cpp_extension import (BuildExtension, CppExtension,
  File "G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\torch\utils\cpp_extension.py", line 25, in <module>
    from pkg_resources import packaging  # type: ignore[attr-defined]
ImportError: cannot import name 'packaging' from 'pkg_resources' (G:\Hail_Haidra\AI-Horde-Worker\conda\envs\windows\lib\site-packages\pkg_resources\__init__.py)
tazlin commented 2 months ago

This repository is an old version if you are looking to do image generation. If you are not trying to alchemy, you should use the worker found here: https://github.com/Haidra-Org/horde-worker-reGen.

Otherwise, you can try deleting your 'conda' folder and reinstalling.

Pup-In-Cup commented 2 months ago

Thank you very much for the prompt reply. I reinstalled the reGen worker and it works properly.