Hi, I’m encountering an issue while trying to use ...
# ask-for-help
u
Hi, I’m encountering an issue while trying to use comfy-pack. I’m running the following command:
Copy code
comfy-pack unpack comfy-pack-pkg-name.cpack.zip
and Im getting the following error:
Copy code
Failed to build `pycocotools @ git+
<https://github.com/nvidia/cocoapi.git@fa44301f7a8b3f95a9f2751d19bfd735b0f6c65d#subdirectory=PythonAPI>`
...
ModuleNotFoundError: No module named 'numpy'
The issue seems to be that the build process is unable to find numpy, even though it's listed in the requirements.txt file that comes with the .cpack.zip package. The numpy & pycocotools requirements are listed in the requirements.txt file in the following order :
Copy code
numpy==1.25.2
pycocotools @ git+<https://github.com/nvidia/cocoapi.git@fa44301f7a8b3f95a9f2751d19bfd735b0f6c65d#subdirectory=PythonAPI>
Can you help?
j
CC: @Frost Ming
f
Things are not what you think. The error occurred when the installer tried to build this package because it did not find an available precompiled wheel, and building this package requires certain dependencies, one of which is numpy. These dependencies are different from those in requirements.txt and must be declared in the
[build-system]
table in the project’s
pyproject.toml
For example, most packages use
setuptool
as the builder so
setuptools
is a build dependency. And other packages may use
flit
or
hatchling
, both are build requirements, not runtime dependencies
However, this is usually not easy to fix if you are not the author of the package. Try export
UV_NO_BUILD_ISOLATION=1
u
Thanks for your response! I tried the suggestion, but I’m getting a similar error:
Copy code
▶ Call to `setuptools.build_meta:__legacy__.prepare_metadata_for_build_wheel` failed (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 8, in <module>
      ModuleNotFoundError: No module named 'setuptools'
Any other suggestions to resolve this? Thanks in advance!
f
add setuptools to requirements.txt
u
I didnt provide the entire error:
Copy code
× Failed to build `pycocotools @ git+<https://github.com/nvidia/cocoapi.git@fa44301f7a8b3f95a9f2751d19bfd735b0f6c65d#subdirectory=PythonAPI>`
  ├─▶ The build backend returned an error
  ╰─▶ Call to `setuptools.build_meta:__legacy__.prepare_metadata_for_build_wheel` failed (exit status: 1)

      [stderr]
      Traceback (most recent call last):
        File "<string>", line 8, in <module>
      ModuleNotFoundError: No module named 'setuptools'
its similar to the error with numpy
f
similar but different right?
😅 1
add setuptools to requirements.txt
u
I manually updated the requirements.txt file but still encountered the same error, so I sent it again. Just to clarify, did you mean installing setuptools directly into the ComfyUI environment and then repacking the flow with comfy-pack? Is there a difference between this approach and updating the requirements.txt file?
f
when
UV_NO_BUILD_ISOLATION=1
the build is done in the same environment you install the dependencies. So it reads the packages in the environment.
so the workaround doesn’t work because of how uv builds packages. can you try installing
setuptools
and
numpy
into the target
.venv
and run
unpack
again?
check if there is a
.venv
under the target workspace folder