WASasquatch / was-node-suite-comfyui

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

Installation error, Can't Get requirements to build Wheel for scipy #109

Closed Anquiax closed 1 year ago

Anquiax commented 1 year ago

This is the error log of the issue I brought up on Civit.ai as Heckerman. The issue being that upon attempting to install WAS node suite using python through Command prompt, I manage to succeed up until the 'Collecting scipy' stage, in which it fails during the 'get requirements to build wheel' step. I believe I was able to successfuly install scipy(?) when I just ran 'pip install scipy' (or the proper command), and the error log - as well as the entire folder it should apparently be in - does not exist in /temp/, which may be part of the issue. I unfortunately don't know where it's installing things, or where the error log truly is. I copied the following log from the command prompt.

Collecting scipy (from -r requirements.txt (line 16))
  Using cached scipy-1.11.1-cp311-cp311-win_amd64.whl (44.0 MB)
  Using cached scipy-1.10.1-cp311-cp311-win_amd64.whl (42.2 MB)
  Using cached scipy-1.10.0-cp311-cp311-win_amd64.whl (42.2 MB)
  Using cached scipy-1.9.3-cp311-cp311-win_amd64.whl (39.9 MB)
  Using cached scipy-1.9.2-cp311-cp311-win_amd64.whl (39.9 MB)
  Using cached scipy-1.9.1.tar.gz (42.0 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [47 lines of output]
      The Meson build system
      Version: 0.62.2
      Source dir: C:\Users\Josh\AppData\Local\Temp\pip-install-5vcduj7l\scipy_39c32cfcb61d444eb444672f90e80e5d
      Build dir: C:\Users\Josh\AppData\Local\Temp\pip-install-5vcduj7l\scipy_39c32cfcb61d444eb444672f90e80e5d\.mesonpy-uoal4nzk\build
      Build type: native build
      Project name: SciPy
      Project version: 1.9.1
      Activating VS 16.3.2

      ..\..\meson.build:1:0: ERROR: Compiler cl can not compile programs.

      A full log can be found at C:\Users\Josh\AppData\Local\Temp\pip-install-5vcduj7l\scipy_39c32cfcb61d444eb444672f90e80e5d\.mesonpy-uoal4nzk\build\meson-logs\meson-log.txt
      + meson setup --native-file=C:\Users\Josh\AppData\Local\Temp\pip-install-5vcduj7l\scipy_39c32cfcb61d444eb444672f90e80e5d\.mesonpy-native-file.ini -Ddebug=false -Doptimization=2 --prefix=C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0 C:\Users\Josh\AppData\Local\Temp\pip-install-5vcduj7l\scipy_39c32cfcb61d444eb444672f90e80e5d C:\Users\Josh\AppData\Local\Temp\pip-install-5vcduj7l\scipy_39c32cfcb61d444eb444672f90e80e5d\.mesonpy-uoal4nzk\build
      Traceback (most recent call last):
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Josh\AppData\Local\Temp\pip-build-env-iahw74vz\overlay\Lib\site-packages\mesonpy\__init__.py", line 969, in get_requires_for_build_wheel
          with _project(config_settings) as project:
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 137, in __enter__
          return next(self.gen)
                 ^^^^^^^^^^^^^^
        File "C:\Users\Josh\AppData\Local\Temp\pip-build-env-iahw74vz\overlay\Lib\site-packages\mesonpy\__init__.py", line 948, in _project
          with Project.with_temp_working_dir(
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\contextlib.py", line 137, in __enter__
          return next(self.gen)
                 ^^^^^^^^^^^^^^
        File "C:\Users\Josh\AppData\Local\Temp\pip-build-env-iahw74vz\overlay\Lib\site-packages\mesonpy\__init__.py", line 777, in with_temp_working_dir
          yield cls(source_dir, tmpdir, build_dir)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Josh\AppData\Local\Temp\pip-build-env-iahw74vz\overlay\Lib\site-packages\mesonpy\__init__.py", line 682, in __init__
          self._configure(reconfigure=bool(build_dir) and not native_file_mismatch)
        File "C:\Users\Josh\AppData\Local\Temp\pip-build-env-iahw74vz\overlay\Lib\site-packages\mesonpy\__init__.py", line 713, in _configure
          self._meson(
        File "C:\Users\Josh\AppData\Local\Temp\pip-build-env-iahw74vz\overlay\Lib\site-packages\mesonpy\__init__.py", line 696, in _meson
          return self._proc('meson', *args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "C:\Users\Josh\AppData\Local\Temp\pip-build-env-iahw74vz\overlay\Lib\site-packages\mesonpy\__init__.py", line 691, in _proc
          subprocess.check_call(list(args))
        File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 413, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['meson', 'setup', '--native-file=C:\\Users\\Josh\\AppData\\Local\\Temp\\pip-install-5vcduj7l\\scipy_39c32cfcb61d444eb444672f90e80e5d\\.mesonpy-native-file.ini', '-Ddebug=false', '-Doptimization=2', '--prefix=C:\\Program Files\\WindowsApps\\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0', 'C:\\Users\\Josh\\AppData\\Local\\Temp\\pip-install-5vcduj7l\\scipy_39c32cfcb61d444eb444672f90e80e5d', 'C:\\Users\\Josh\\AppData\\Local\\Temp\\pip-install-5vcduj7l\\scipy_39c32cfcb61d444eb444672f90e80e5d\\.mesonpy-uoal4nzk\\build']' 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: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
WASasquatch commented 1 year ago

Do you have vs build tools and in your environment PATH?

Meson may be installable with pip but also needs to be in path apparently? Though this was never needed for me on win11

https://mesonbuild.com/Getting-meson.html

Anquiax commented 1 year ago

I'm not sure what exactly did it, but I think I fixed it... kinda. Things that I did included putting the supposed installation directories of meson and python in PATH, putting visual studio's IDE folder in PATH, (these didnt fix anything) then reinstalling python entirely, as I had installed python 3.11 through the windows store at some point while 3.10 seemed to work (reinstallation was needed to get 3.10 running through cmd). However, I still get an issue when running comfyui relating to missing the modules 'ftfy', 'numba', and 'mmcv', resulting in an (IMPORT FAILED) for was and 2 other custom nodes, however running 'pip install ftfy' does not fix it - I have it installed, yet when I run comfyui it simply does not register them. I should mention this issue only started occurring after I managed to get the Node suite requirements to run without throwing an error. The file path of the modules should be in PATH, so i dont think that's the issue. I do have python 3.10.9 installed (I had to reinstall python again, to go from 3.10.0 to 3.10.9, in case that change something) so python version shouldn't be the issue either. Im not fully sure if this is an issue related more to comfyui or the node suite, though.

WASasquatch commented 1 year ago

Yeah ComfyUi is for Python 3.10 only currently I believe.

Anquiax commented 1 year ago

I've managed to isolate a persisting issue to only the node suite - mmcv and ftfy issues came from other custom nodes, but the node suite still can't find 'Numba' whenever I have it inside the 'custom-nodes' folder. I've already installed numba, I've installed numpy, but it just doesnt work. considering that this happens with any custom node folder I put in, im beginning to believe this is an issue with comfyui itself, rather than the node suite.

WASasquatch commented 1 year ago

You have to install all requirements to the ComfyUI executing python.exe.

In usual windows portable download that's under python_embedded/ and you have to run pip stuff with that exe.

Sounds like you are installing to system python, and not the python ComfyUI is using cause you have portable and did not install manually from repo source.

Anquiax commented 1 year ago

That was it. That was actually the issue. After using the python.exe that comfyui installed to install all the modules it worked. it actually worked. Everything worked. Thank you, you're a godsend.

WASasquatch commented 1 year ago

No problem. That's the most common problem installing these fandangled custom nodes.

eli-schwartz commented 1 year ago

and the error log - as well as the entire folder it should apparently be in - does not exist in /temp/, which may be part of the issue. I unfortunately don't know where it's installing things, or where the error log truly is.

Unfortunately, pip install deletes all traces of the temporary work directory used to download and compile packages. IIRC there may be a non-default pip option to save that information...

Collecting scipy (from -r requirements.txt (line 16))
  Using cached scipy-1.11.1-cp311-cp311-win_amd64.whl (44.0 MB)
  Using cached scipy-1.10.1-cp311-cp311-win_amd64.whl (42.2 MB)
  Using cached scipy-1.10.0-cp311-cp311-win_amd64.whl (42.2 MB)
  Using cached scipy-1.9.3-cp311-cp311-win_amd64.whl (39.9 MB)
  Using cached scipy-1.9.2-cp311-cp311-win_amd64.whl (39.9 MB)
  Using cached scipy-1.9.1.tar.gz (42.0 MB)

Apparently it tried several cached wheels before giving up, and attempting to build SciPy from source.

(At that point, you ran headlong into the fact that SciPy is a pretty complicated project to build from source, which needs not only a C/C++ compiler, but also a Fortran one -- the Fortran part in particular makes it extremely nontrivial to build on Windows specifically.)