WASasquatch / was-node-suite-comfyui

An extensive node suite for ComfyUI with over 210 new nodes
MIT License
1.22k stars 177 forks source link

Error when installing on ComfyUI Portable #60

Closed robertvoy closed 1 year ago

robertvoy commented 1 year ago

Hey when I'm installing, I'm getting the error below:

I'm running win11. I have CMake and VC installed.

Building wheels for collected packages: img2texture, dlib
  Building wheel for img2texture (setup.py) ... done
  Created wheel for img2texture: filename=img2texture-1.0.6-py3-none-any.whl size=8446 sha256=f968f1fefb2b1e236fe559e1ea98f1248ec7b18f87698ef295c3724c371735ba
  Stored in directory: C:\Users\rober\AppData\Local\Temp\pip-ephem-wheel-cache-i9r6fdix\wheels\ef\01\9f\2a02c1af22973c81e59b3e7c5a63a57bc73050b9176aa479d2
  Building wheel for dlib (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [72 lines of output]
      running bdist_wheel
      running build
      running build_py
      running build_ext
      C:\Users\rober\AppData\Local\Temp\pip-install-4yupo77g\dlib_e6c66c779238475e99bbf295adb90bd1\setup.py:129: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
        if LooseVersion(cmake_version) < '3.1.0':
      Building extension for Python 3.10.9 (tags/v3.10.9:1dd9be6, Dec  6 2022, 20:01:21) [MSC v.1934 64 bit (AMD64)]
      Invoking CMake setup: 'cmake C:\Users\rober\AppData\Local\Temp\pip-install-4yupo77g\dlib_e6c66c779238475e99bbf295adb90bd1\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\rober\AppData\Local\Temp\pip-install-4yupo77g\dlib_e6c66c779238475e99bbf295adb90bd1\build\lib.win-amd64-cpython-310 -DPYTHON_EXECUTABLE=C:\ComfyUI\python_embeded\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\rober\AppData\Local\Temp\pip-install-4yupo77g\dlib_e6c66c779238475e99bbf295adb90bd1\build\lib.win-amd64-cpython-310 -A x64'
      -- Building for: Visual Studio 17 2022
      -- Selecting Windows SDK version 10.0.22000.0 to target Windows 10.0.22621.
      -- The C compiler identification is MSVC 19.35.32217.1
      -- The CXX compiler identification is MSVC 19.35.32217.1
      -- Detecting C compiler ABI info
      -- Detecting C compiler ABI info - done
      -- Check for working C compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting C compile features
      -- Detecting C compile features - done
      -- Detecting CXX compiler ABI info
      -- Detecting CXX compiler ABI info - done
      -- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.35.32215/bin/Hostx64/x64/cl.exe - skipped
      -- Detecting CXX compile features
      -- Detecting CXX compile features - done
      -- pybind11 v2.10.0
      -- Found PythonInterp: C:/ComfyUI/python_embeded/python.exe (found suitable version "3.10.9", minimum required is "3.6")
      CMake Error at C:/Users/rober/AppData/Local/Temp/pip-install-4yupo77g/dlib_e6c66c779238475e99bbf295adb90bd1/dlib/external/pybind11/tools/FindPythonLibsNew.cmake:236 (message):
        Python libraries not found
      Call Stack (most recent call first):
        C:/Users/rober/AppData/Local/Temp/pip-install-4yupo77g/dlib_e6c66c779238475e99bbf295adb90bd1/dlib/external/pybind11/tools/pybind11Tools.cmake:50 (find_package)
        C:/Users/rober/AppData/Local/Temp/pip-install-4yupo77g/dlib_e6c66c779238475e99bbf295adb90bd1/dlib/external/pybind11/tools/pybind11Common.cmake:180 (include)
        C:/Users/rober/AppData/Local/Temp/pip-install-4yupo77g/dlib_e6c66c779238475e99bbf295adb90bd1/dlib/external/pybind11/CMakeLists.txt:200 (include)

      -- Configuring incomplete, errors occurred!
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\rober\AppData\Local\Temp\pip-install-4yupo77g\dlib_e6c66c779238475e99bbf295adb90bd1\setup.py", line 222, in <module>
          setup(
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
          return run_commands(dist)
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
          dist.run_commands()
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\dist.py", line 1244, in run_command
          super().run_command(command)
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\ComfyUI\python_embeded\lib\site-packages\wheel\bdist_wheel.py", line 343, in run
          self.run_command("build")
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\dist.py", line 1244, in run_command
          super().run_command(command)
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\_distutils\command\build.py", line 131, in run
          self.run_command(cmd_name)
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\dist.py", line 1244, in run_command
          super().run_command(command)
        File "C:\ComfyUI\python_embeded\lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
          cmd_obj.run()
        File "C:\Users\rober\AppData\Local\Temp\pip-install-4yupo77g\dlib_e6c66c779238475e99bbf295adb90bd1\setup.py", line 134, in run
          self.build_extension(ext)
        File "C:\Users\rober\AppData\Local\Temp\pip-install-4yupo77g\dlib_e6c66c779238475e99bbf295adb90bd1\setup.py", line 171, in build_extension
          subprocess.check_call(cmake_setup, cwd=build_folder)
        File "subprocess.py", line 369, in check_call
      subprocess.CalledProcessError: Command '['cmake', 'C:\\Users\\rober\\AppData\\Local\\Temp\\pip-install-4yupo77g\\dlib_e6c66c779238475e99bbf295adb90bd1\\tools\\python', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\\Users\\rober\\AppData\\Local\\Temp\\pip-install-4yupo77g\\dlib_e6c66c779238475e99bbf295adb90bd1\\build\\lib.win-amd64-cpython-310', '-DPYTHON_EXECUTABLE=C:\\ComfyUI\\python_embeded\\python.exe', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\\Users\\rober\\AppData\\Local\\Temp\\pip-install-4yupo77g\\dlib_e6c66c779238475e99bbf295adb90bd1\\build\\lib.win-amd64-cpython-310', '-A', 'x64']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for dlib
  Running setup.py clean for dlib
Successfully built img2texture
Failed to build dlib
ERROR: Could not build wheels for dlib, which is required to install pyproject.toml-based projects
WASasquatch commented 1 year ago

That's new. It seems cmake can't be found regardless, it seems.

Check out this topic on SO: https://stackoverflow.com/questions/41912372/dlib-installation-on-windows-10

To install stuff to the portable python you can run commands from python_embedded folder like ./python.exe -m pip install --force-reinstall --upgrade cmake dlib

The first answer there may be of help with the specific whl version.


Also be sure that you're installing the requirements to ComfyUI and not your system's Python by running your requirements command from python_embedded folders python ./python.exe -m pip install /full/path/to/requirements.txt

That being said, WAS Node Suite will try to install dependencies on the fly. So for example, if you aren't planning to use the seamless texture node, you wouldn't need to worry about needing img2texture dependency.

robertvoy commented 1 year ago

Ok, I got it to work.

For anyone using ComfyUI Portable with Python 3.10.9, Windows 64-bit

You need to download: dlib-19.22.99-cp310-cp310-win_amd64.whl

Then install it to the portable Python: C:\ComfyUI\python_embeded\python.exe -m pip install dlib-19.22.99-cp310-cp310-win_amd64.whl

After that, it will work.

WASasquatch commented 1 year ago

Ok, I got it to work.

For anyone using ComfyUI Portable with Python 3.10.9, Windows 64-bit

You need to download: dlib-19.22.99-cp310-cp310-win_amd64.whl

Then install it to the portable Python: C:\ComfyUI\python_embeded\python.exe -m pip install dlib-19.22.99-cp310-cp310-win_amd64.whl

After that, it will work.

Wonder if that's appropriate to add to requirements.txt or maybe a check within the program itself to detect windows and attempt to install it if it's missing, assuming it installs under the name "dlib" ? Could you check your pip freeze ?

robertvoy commented 1 year ago

Yeah it installs under the name dlib

dlib @ file:///C:/users/robert/downloads/dlib-19.22.99-cp310-cp310-win_amd64.whl#sha256=f2181b6724669fb0147c9ebc326d72b94de41bced1812eff5df4b133b5d0b575

WASasquatch commented 1 year ago

Yeah it installs under the name dlib

dlib @ file:///C:/users/robert/downloads/dlib-19.22.99-cp310-cp310-win_amd64.whl#sha256=f2181b6724669fb0147c9ebc326d72b94de41bced1812eff5df4b133b5d0b575

Thank you.

fernicar commented 1 year ago

I can't load the extension after update (02d9afbfb8ed8e7bf0724a4c04ba116096adadf7) Where do you see include Python.h usually in windows 10? I have it in "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python39_64\include"


  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [11 lines of output]
      running bdist_wheel
      running build
      running build_ext
      building 'numa' extension
      creating build
      creating build\temp.win-amd64-cpython-310
      creating build\temp.win-amd64-cpython-310\Release
      "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\bin\HostX86\x64\cl.exe" /c /nologo /O2 /W3 /GL /DNDEBUG /MD -DNUMA_VERSION1_COMPATIBILITY=1 -IG:\StableDiffusion\ComfyUI_windows_portable\python_embeded\include -IG:\StableDiffusion\ComfyUI_windows_portable\python_embeded\Include "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\ATLMFC\include" "-IC:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\VS\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.22000.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\um" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\shared" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\winrt" "-IC:\Program Files (x86)\Windows Kits\10\\include\10.0.22000.0\\cppwinrt" "-IC:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um" /Tcnuma.c /Fobuild\temp.win-amd64-cpython-310\Release\numa.obj
      numa.c
      numa.c(4): fatal error C1083: Cannot open include file: 'Python.h': No such file or directory
      error: command 'C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.36.32532\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for numa
  Running setup.py clean for numa
Successfully built img2texture
Failed to build numa
ERROR: Could not build wheels for numa, which is required to install pyproject.toml-based projects```
WASasquatch commented 1 year ago

Looks like typo. It should be "numba" for JIT.