bmaltais / kohya_ss

Apache License 2.0
9.39k stars 1.22k forks source link

Can't install - Gradio won't install #2688

Open emanueljoab opened 1 month ago

emanueljoab commented 1 month ago

Every single time I try to run setup I get the following error:

Collecting fastapi (from gradio==4.36.1->-r requirements.txt (line 10))
  Using cached fastapi-0.112.0-py3-none-any.whl.metadata (27 kB)
Collecting ffmpy (from gradio==4.36.1->-r requirements.txt (line 10))
  Using cached ffmpy-0.4.0-py3-none-any.whl.metadata (2.9 kB)
Collecting gradio-client==1.0.1 (from gradio==4.36.1->-r requirements.txt (line 10))
  Using cached gradio_client-1.0.1-py3-none-any.whl.metadata (7.1 kB)
Collecting httpx>=0.24.1 (from gradio==4.36.1->-r requirements.txt (line 10))
  Using cached httpx-0.27.0-py3-none-any.whl.metadata (7.2 kB)
Collecting importlib-resources<7.0,>=1.3 (from gradio==4.36.1->-r requirements.txt (line 10))
  Using cached importlib_resources-6.4.0-py3-none-any.whl.metadata (3.9 kB)
Requirement already satisfied: markupsafe~=2.0 in d:\kohya_ss\venv\lib\site-packages (from gradio==4.36.1->-r requirements.txt (line 10)) (2.1.5)
Collecting matplotlib~=3.0 (from gradio==4.36.1->-r requirements.txt (line 10))
  Using cached matplotlib-3.9.1.tar.gz (36.1 MB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [22 lines of output]
      + meson setup C:\Users\emanu\AppData\Local\Temp\pip-install-uq28r0ir\matplotlib_95177d3e65b54c74833f08a5c80ab690 C:\Users\emanu\AppData\Local\Temp\pip-install-uq28r0ir\matplotlib_95177d3e65b54c74833f08a5c80ab690\.mesonpy-q8is_4kw -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md --native-file=C:\Users\emanu\AppData\Local\Temp\pip-install-uq28r0ir\matplotlib_95177d3e65b54c74833f08a5c80ab690\.mesonpy-q8is_4kw\meson-python-native-file.ini
      The Meson build system
      Version: 1.5.1
      Source dir: C:\Users\emanu\AppData\Local\Temp\pip-install-uq28r0ir\matplotlib_95177d3e65b54c74833f08a5c80ab690
      Build dir: C:\Users\emanu\AppData\Local\Temp\pip-install-uq28r0ir\matplotlib_95177d3e65b54c74833f08a5c80ab690\.mesonpy-q8is_4kw
      Build type: native build
      Program python3 found: YES
      Project name: matplotlib
      Project version: 3.9.1
      WARNING: Failed to activate VS environment: Could not parse vswhere.exe output

      ..\meson.build:1:0: ERROR: Unknown compiler(s): [['icl'], ['cl'], ['cc'], ['gcc'], ['clang'], ['clang-cl'], ['pgcc']]
      The following exception(s) were encountered:
      Running `icl ""` gave "[WinError 2] O sistema não pode encontrar o arquivo especificado"
      Running `cl /?` gave "[WinError 2] O sistema não pode encontrar o arquivo especificado"
      Running `cc --version` gave "[WinError 2] O sistema não pode encontrar o arquivo especificado"
      Running `gcc --version` gave "[WinError 2] O sistema não pode encontrar o arquivo especificado"
      Running `clang --version` gave "[WinError 2] O sistema não pode encontrar o arquivo especificado"
      Running `clang-cl /?` gave "[WinError 2] O sistema não pode encontrar o arquivo especificado"
      Running `pgcc --version` gave "[WinError 2] O sistema não pode encontrar o arquivo especificado"

      A full log can be found at C:\Users\emanu\AppData\Local\Temp\pip-install-uq28r0ir\matplotlib_95177d3e65b54c74833f08a5c80ab690\.mesonpy-q8is_4kw\meson-logs\meson-log.txt
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I've tried:

I'm using Windows 11.

b-fission commented 1 month ago

Your system doesn't have the Visual Studio C++ compiler installed, so installing matplotlib from source won't work.

Can you open a command line at the kohya_ss folder, run this command: venv\scripts\pip.exe install --prefer-binary matplotlib

If that worked, then you can try setup again.

emanueljoab commented 1 month ago

Your system doesn't have the Visual Studio C++ compiler installed, so installing matplotlib from source won't work.

Can you open a command line at the kohya_ss folder, run this command: venv\scripts\pip.exe install --prefer-binary matplotlib

If that worked, then you can try setup again.

Thanks, it seems to work. But why not put it on installation in the read me? Because I don't think many people has C++ Compiler pre-installed.

b-fission commented 1 month ago

It looks like a problem with matplotlib's packaging. Their latest version 3.9.1 (released a month ago) has no official binaries for Windows, so pip is trying to build from source.