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

ComfyUI embedded installation failure #41

Closed
ghostsquad opened this issue May 29, 2024 · 4 comments
Closed

ComfyUI embedded installation failure #41

ghostsquad opened this issue May 29, 2024 · 4 comments
Labels
bug Something isn't working pending Pending ComfyUI or custom node changes

Comments

@ghostsquad
Copy link

I ran through this, with slightly different steps:

https://github.com/Chaoses-Ib/ComfyScript?tab=readme-ov-file#with-comfyui

cd /e/custom_nodes/ComfyScript
/e/ComfyUI_windows_portable/python_embeded/python -m pip install -e ".[default]"
$ /e/ComfyUI_windows_portable/python_embeded/python -m pip install -e ".[default]"
Obtaining file:///E:/custom_nodes/ComfyScript
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
ERROR: Exception:
Traceback (most recent call last):
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\cli\base_command.py", line 180, in exc_logging_wrapper
    status = run_func(*args)
             ^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\cli\req_command.py", line 245, in wrapper
    return func(self, options, args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\commands\install.py", line 377, in run
    requirement_set = resolver.resolve(
                      ^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 76, in resolve
    collected = self.factory.collect_root_requirements(root_reqs)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 534, in collect_root_requirements
    reqs = list(
           ^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 490, in _make_requirements_from_install_req
    cand = self._make_base_candidate_from_link(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 207, in _make_base_candidate_from_link
    self._editable_candidate_cache[link] = EditableCandidate(
                                           ^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 315, in __init__
    super().__init__(
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 156, in __init__
    self.dist = self._prepare()
                ^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 222, in _prepare
    dist = self._prepare_distribution()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 325, in _prepare_distribution
    return self._factory.preparer.prepare_editable_requirement(self._ireq)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\operations\prepare.py", line 696, in prepare_editable_requirement
    dist = _get_prepared_distribution(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\operations\prepare.py", line 71, in _get_prepared_distribution
    abstract_dist.prepare_distribution_metadata(
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\distributions\sdist.py", line 52, in prepare_distribution_metadata
    self.req.isolated_editable_sanity_check()
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\req\req_install.py", line 545, in isolated_editable_sanity_check
    and not self.supports_pyproject_editable()
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_internal\req\req_install.py", line 257, in supports_pyproject_editable
    return "build_editable" in self.pep517_backend._supported_features()
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_vendor\pyproject_hooks\_impl.py", line 153, in _supported_features
    return self._call_hook('_supported_features', {})
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_vendor\pyproject_hooks\_impl.py", line 321, in _call_hook
    raise BackendUnavailable(data.get('traceback', ''))
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Traceback (most recent call last):
  File "E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 77, in _build_backend
    obj = import_module(mod_path)
          ^^^^^^^^^^^^^^^^^^^^^^^
  File "importlib\__init__.py", line 126, in import_module
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1126, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'hatchling'

any ideas about this?

@Chaoses-Ib Chaoses-Ib added the bug Something isn't working label May 29, 2024
@Chaoses-Ib
Copy link
Owner

Running python -m pip install hatchling first should fix it. hatchling should be auto installed normally. I'm not sure about your case. Perhaps it's the pip you are using is too old to support it. Can you provide your pip version (running python -m pip -V)?

@ghostsquad
Copy link
Author

ghostsquad commented May 29, 2024

I did run python -m pip -U pip to upgrade pip

pip 24.0 from E:\ComfyUI_windows_portable\python_embeded\Lib\site-packages\pip (python 3.11)

ran the following (from ComfyScript directory)

/e/ComfyUI_windows_portable/python_embeded/python -m pip install -e ".[default]"
...
ModuleNotFoundError: No module named 'editables'
/e/ComfyUI_windows_portable/python_embeded/python -m pip install editables"
...
Successfully installed editables-0.5
/e/ComfyUI_windows_portable/python_embeded/python -m pip install -e ".[default]"
...
Building wheels for collected packages: comfy-script
  Building editable for comfy-script (pyproject.toml) ... done
  Created wheel for comfy-script: filename=comfy_script-0.5.0a5-py3-none-any.whl size=7308 sha256=a0f9cb2760d915de69b3baaae51f88235d6c844ee3e50f83e23e2d72f6ba1aca
  Stored in directory: C:\Users\ghost\AppData\Local\Temp\pip-ephem-wheel-cache-8h25pue5\wheels\cd\51\b1\d47eb54ed9a8107f94e5fa9178af7448dd0126521e816c8c4c
Successfully built comfy-script
Installing collected packages: civitai-comfy-nodes, aenum, dynaconf, comfy-script
  WARNING: The script dynaconf.exe is installed in 'E:\ComfyUI_windows_portable\python_embeded\Scripts' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed aenum-3.1.15 civitai-comfy-nodes-0.2.0 comfy-script-0.5.0a5 dynaconf-3.2.5

🎉 success

so it seems there's a few things missing in requirements.txt perhaps?

@Chaoses-Ib
Copy link
Owner

The pip install only uses https://github.com/Chaoses-Ib/ComfyScript/blob/main/pyproject.toml. hatchling is required in the [build-system] section. It seems hatchling changed the way to install editables three months ago (pypa/hatch#1255). I'm not sure why the new get_requires_for_build_editable hook doesn't work for you.

@Chaoses-Ib Chaoses-Ib added the pending Pending ComfyUI or custom node changes label Jun 17, 2024
@Chaoses-Ib
Copy link
Owner

Since this is an upstream bug, I can't fix it. But I've added the workaround to Troubleshooting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending Pending ComfyUI or custom node changes
Projects
None yet
Development

No branches or pull requests

2 participants