lllyasviel / stable-diffusion-webui-forge

GNU Affero General Public License v3.0
8.4k stars 818 forks source link

ERROR: Failed to build installable wheels for some pyproject.toml based projects (Pillow) #1789

Open fahadshery opened 2 months ago

fahadshery commented 2 months ago

Hi,

I tied both docker and non docker install using venv but error seems to the same. Here is the trace:

snip....
      copying src/PIL/PpmImagePlugin.py -> build/lib.linux-x86_64-cpython-312/PIL
      copying src/PIL/PsdImagePlugin.py -> build/lib.linux-x86_64-cpython-312/PIL
      copying src/PIL/BmpImagePlugin.py -> build/lib.linux-x86_64-cpython-312/PIL
      running egg_info
      writing src/Pillow.egg-info/PKG-INFO
      writing dependency_links to src/Pillow.egg-info/dependency_links.txt
      writing requirements to src/Pillow.egg-info/requires.txt
      writing top-level names to src/Pillow.egg-info/top_level.txt
      reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no files found matching '*.c'
      warning: no files found matching '*.h'
      warning: no files found matching '*.sh'
      warning: no files found matching '*.txt'
      warning: no previously-included files found matching '.appveyor.yml'
      warning: no previously-included files found matching '.clang-format'
      warning: no previously-included files found matching '.coveragerc'
      warning: no previously-included files found matching '.editorconfig'
      warning: no previously-included files found matching '.readthedocs.yml'
      warning: no previously-included files found matching 'codecov.yml'
      warning: no previously-included files found matching 'renovate.json'
      warning: no previously-included files matching '.git*' found anywhere in distribution
      warning: no previously-included files matching '*.pyc' found anywhere in distribution
      warning: no previously-included files matching '*.so' found anywhere in distribution
      no previously-included directories found matching '.ci'
      adding license file 'LICENSE'
      writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
      running build_ext

      The headers or library files could not be found for jpeg,
      a required dependency when compiling Pillow from source.

      Please see the install instructions at:
         https://pillow.readthedocs.io/en/latest/installation.html

      Traceback (most recent call last):
        File "/tmp/pip-install-g3e107g4/pillow_ac5582fee66e44aa96d2189fe0bc04ae/setup.py", line 993, in <module>
          setup(
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 184, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 200, in run_commands
          dist.run_commands()
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 954, in run_commands
          self.run_command(cmd)
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 950, in run_command
          super().run_command(command)
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/command/bdist_wheel.py", line 384, in run
          self.run_command("build")
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 950, in run_command
          super().run_command(command)
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/dist.py", line 950, in run_command
          super().run_command(command)
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 973, in run_command
          cmd_obj.run()
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/command/build_ext.py", line 98, in run
          _build_ext.run(self)
        File "/home/user/ai-stack/stable-diffusion-webui-forge/.venv/lib/python3.12/site-packages/setuptools/_distutils/command/build_ext.py", line 359, in run
          self.build_extensions()
        File "/tmp/pip-install-g3e107g4/pillow_ac5582fee66e44aa96d2189fe0bc04ae/setup.py", line 809, in build_extensions
          raise RequiredDependencyException(f)
      RequiredDependencyException: jpeg

      During handling of the above exception, another exception occurred:

      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-g3e107g4/pillow_ac5582fee66e44aa96d2189fe0bc04ae/setup.py", line 1010, in <module>
          raise RequiredDependencyException(msg)
      RequiredDependencyException:

      The headers or library files could not be found for jpeg,
      a required dependency when compiling Pillow from source.

      Please see the install instructions at:
         https://pillow.readthedocs.io/en/latest/installation.html

      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for Pillow
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (Pillow)

this is what I did:

  1. Clone the repo
  2. python3 -m venv .venv
  3. source .venv/bin/activate
  4. pip install --upgrade pip setuptools wheel
  5. pip install Pillow==9.5.0 (fails)
  6. pip install Pillow (installs successfully)
  7. ./webui.sh
sydidelot commented 1 month ago

I ran into the same problem and I managed to fixed this by installing these 2 packages on Ubuntu: sudo apt install libjpeg-dev zlib1g-dev (not sure if the second package is really needed)

The problem is actually a missing dependency to jpeg: RequiredDependencyException: jpeg

fahadshery commented 1 month ago

I ran into the same problem and I managed to fixed this by installing these 2 packages on Ubuntu: sudo apt install libjpeg-dev zlib1g-dev (not sure if the second package is really needed)

The problem is actually a missing dependency to jpeg: RequiredDependencyException: jpeg

docker image should build all the dependencies, I shouldn't be installing anything on the host VM. that's the whole point of containerisation?