Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WinForms Testbed is unable to install Pillow dependency on python 3.12 #2883

Closed
proneon267 opened this issue Oct 6, 2024 · 4 comments · Fixed by #2497
Closed

WinForms Testbed is unable to install Pillow dependency on python 3.12 #2883

proneon267 opened this issue Oct 6, 2024 · 4 comments · Fixed by #2497
Labels
bug A crash or error in behavior. documentation An improvement required in the project's documentation. good first issue Is this your first time contributing? This could be a good place to start!

Comments

@proneon267
Copy link
Contributor

proneon267 commented Oct 6, 2024

Describe the bug

Briefcase will fail to install Pillow dependency due to unavailable wheels for python 3.12 for the testbed app.

Steps to reproduce

  1. Clone the latest main branch and go to testbed:
git clone https://github.com/beeware/toga.git toga
cd toga/testbed
  1. Run the testbed:
briefcase dev --test
  1. Briefcase will fail to install Pillow dependency:
Error Output:

(venv) PS E:\toga\testbed> briefcase dev

[testbed] Installing requirements...
Processing e:\toga\core
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Processing e:\toga\winforms
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Preparing metadata (pyproject.toml): started
  Preparing metadata (pyproject.toml): finished with status 'done'
Ignoring fonttools: markers 'sys_platform == "linux"' don't match your environment
Collecting coverage==7.6.1
  Using cached coverage-7.6.1-cp312-cp312-win_amd64.whl.metadata (8.5 kB)
Collecting coverage-conditional-plugin==0.9.0
  Using cached coverage_conditional_plugin-0.9.0-py3-none-any.whl.metadata (6.9 kB)
Collecting pillow==9.2.0
  Using cached Pillow-9.2.0.tar.gz (50.0 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Collecting pytest==8.3.3
  Using cached pytest-8.3.3-py3-none-any.whl.metadata (7.5 kB)
Collecting pytest-asyncio==0.24.0
  Using cached pytest_asyncio-0.24.0-py3-none-any.whl.metadata (3.9 kB)
Requirement already satisfied: packaging>=20.4 in e:\venv\lib\site-packages (from coverage-conditional-plugin==0.9.0) (24.1)
Collecting iniconfig (from pytest==8.3.3)
  Using cached iniconfig-2.0.0-py3-none-any.whl.metadata (2.6 kB)
Collecting pluggy<2,>=1.5 (from pytest==8.3.3)
  Using cached pluggy-1.5.0-py3-none-any.whl.metadata (4.8 kB)
Requirement already satisfied: colorama in e:\venv\lib\site-packages (from pytest==8.3.3) (0.4.6)
Collecting travertino>=0.3.0 (from toga-core==0.4.8.dev22+gddd814e86)
  Using cached travertino-0.3.0-py3-none-any.whl.metadata (4.3 kB)
Collecting pythonnet>=3.0.0 (from toga-winforms==0.4.8.dev22+gddd814e86)
  Using cached pythonnet-3.0.4-py3-none-any.whl.metadata (6.6 kB)
Collecting clr-loader<0.3.0,>=0.2.6 (from pythonnet>=3.0.0->toga-winforms==0.4.8.dev22+gddd814e86)
  Using cached clr_loader-0.2.6-py3-none-any.whl.metadata (1.4 kB)
Collecting cffi>=1.13 (from clr-loader<0.3.0,>=0.2.6->pythonnet>=3.0.0->toga-winforms==0.4.8.dev22+gddd814e86)
  Using cached cffi-1.17.1-cp312-cp312-win_amd64.whl.metadata (1.6 kB)
Collecting pycparser (from cffi>=1.13->clr-loader<0.3.0,>=0.2.6->pythonnet>=3.0.0->toga-winforms==0.4.8.dev22+gddd814e86)
  Using cached pycparser-2.22-py3-none-any.whl.metadata (943 bytes)
Using cached coverage-7.6.1-cp312-cp312-win_amd64.whl (210 kB)
Using cached coverage_conditional_plugin-0.9.0-py3-none-any.whl (7.3 kB)
Using cached pytest-8.3.3-py3-none-any.whl (342 kB)
Using cached pytest_asyncio-0.24.0-py3-none-any.whl (18 kB)
Using cached pluggy-1.5.0-py3-none-any.whl (20 kB)
Using cached pythonnet-3.0.4-py3-none-any.whl (295 kB)
Using cached travertino-0.3.0-py3-none-any.whl (16 kB)
Using cached iniconfig-2.0.0-py3-none-any.whl (5.9 kB)
Using cached clr_loader-0.2.6-py3-none-any.whl (51 kB)
Using cached cffi-1.17.1-cp312-cp312-win_amd64.whl (181 kB)
Using cached pycparser-2.22-py3-none-any.whl (117 kB)
Building wheels for collected packages: pillow, toga-core, toga-winforms
  Building wheel for pillow (setup.py): started
  Building wheel for pillow (setup.py): finished with status 'error'
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [189 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\BdfFontFile.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\BlpImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\BmpImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\BufrStubImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ContainerIO.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\CurImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\DcxImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\DdsImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\EpsImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ExifTags.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\features.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\FitsImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\FitsStubImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\FliImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\FontFile.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\FpxImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\FtexImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\GbrImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\GdImageFile.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\GifImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\GimpGradientFile.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\GimpPaletteFile.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\GribStubImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\Hdf5StubImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\IcnsImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\IcoImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\Image.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageChops.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageCms.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageColor.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageDraw.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageDraw2.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageEnhance.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageFile.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageFilter.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageFont.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageGrab.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageMath.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageMode.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageMorph.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageOps.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImagePalette.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImagePath.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageQt.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageSequence.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageShow.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageStat.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageTk.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageTransform.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImageWin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\ImtImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\IptcImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\Jpeg2KImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\JpegImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\JpegPresets.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\McIdasImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\MicImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\MpegImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\MpoImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\MspImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PaletteFile.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PalmImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PcdImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PcfFontFile.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PcxImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PdfImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PdfParser.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PixarImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PngImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PpmImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PsdImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PSDraw.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\PyAccess.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\SgiImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\SpiderImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\SunImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\TarIO.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\TgaImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\TiffImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\TiffTags.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\WalImageFile.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\WebPImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\WmfImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\XbmImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\XpmImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\XVThumbImagePlugin.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\_binary.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\_deprecate.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\_tkinter_finder.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\_util.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\_version.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\__init__.py -> build\lib.win-amd64-cpython-312\PIL
      copying src\PIL\__main__.py -> build\lib.win-amd64-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 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 zlib,
      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 "C:\Users\proneon267\AppData\Local\Temp\pip-install-g7l4yhln\pillow_f1a9513ee4274414b3f55a97e91eaf46\setup.py", line 995, in <module>
          setup(
        File "E:\venv\Lib\site-packages\setuptools\__init__.py", line 117, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "E:\venv\Lib\site-packages\setuptools\_distutils\core.py", line 183, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "E:\venv\Lib\site-packages\setuptools\_distutils\core.py", line 199, in run_commands
          dist.run_commands()
        File "E:\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 954, in run_commands
          self.run_command(cmd)
        File "E:\venv\Lib\site-packages\setuptools\dist.py", line 950, in run_command
          super().run_command(command)
        File "E:\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
          cmd_obj.run()
        File "E:\venv\Lib\site-packages\setuptools\command\bdist_wheel.py", line 398, in run
          self.run_command("build")
        File "E:\venv\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "E:\venv\Lib\site-packages\setuptools\dist.py", line 950, in run_command
          super().run_command(command)
        File "E:\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
          cmd_obj.run()
        File "E:\venv\Lib\site-packages\setuptools\_distutils\command\build.py", line 135, in run
          self.run_command(cmd_name)
        File "E:\venv\Lib\site-packages\setuptools\_distutils\cmd.py", line 316, in run_command
          self.distribution.run_command(command)
        File "E:\venv\Lib\site-packages\setuptools\dist.py", line 950, in run_command
          super().run_command(command)
        File "E:\venv\Lib\site-packages\setuptools\_distutils\dist.py", line 973, in run_command
          cmd_obj.run()
        File "E:\venv\Lib\site-packages\setuptools\command\build_ext.py", line 98, in run
          _build_ext.run(self)
        File "E:\venv\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 359, in run
          self.build_extensions()
        File "C:\Users\proneon267\AppData\Local\Temp\pip-install-g7l4yhln\pillow_f1a9513ee4274414b3f55a97e91eaf46\setup.py", line 810, in build_extensions
          raise RequiredDependencyException(f)
      RequiredDependencyException: zlib

      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 "C:\Users\proneon267\AppData\Local\Temp\pip-install-g7l4yhln\pillow_f1a9513ee4274414b3f55a97e91eaf46\setup.py", line 1015, in <module>
          raise RequiredDependencyException(msg)
      RequiredDependencyException:

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

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


      C:\Users\proneon267\AppData\Local\Temp\pip-install-g7l4yhln\pillow_f1a9513ee4274414b3f55a97e91eaf46\setup.py:45: RuntimeWarning: Pillow 9.2.0 does not support Python 3.12 and does not provide prebuilt Windows binaries. We do not recommend building from source on Windows.
        lambda: warnings.warn(
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pillow
  Running setup.py clean for pillow
  Building wheel for toga-core (pyproject.toml): started
  Building wheel for toga-core (pyproject.toml): finished with status 'done'
  Created wheel for toga-core: filename=toga_core-0.4.8.dev22+gddd814e86-py3-none-any.whl size=141387 sha256=fbbd2677c5e7cfdcfe090dd5497d7286b9ca6108270ca091b6b0c95e14f29570
  Stored in directory: C:\Users\proneon267\AppData\Local\Temp\pip-ephem-wheel-cache-r1fey72j\wheels\e8\36\78\df362e45efa7a9bc2cb8a6c2a8297498657bc97da12e054f19
  Building wheel for toga-winforms (pyproject.toml): started
  Building wheel for toga-winforms (pyproject.toml): finished with status 'done'
  Created wheel for toga-winforms: filename=toga_winforms-0.4.8.dev22+gddd814e86-py3-none-any.whl size=454959 sha256=8c1eedbefbf4892508c760814b8234708bccaf58bece01ac3aca9ba8f2d051d6
  Stored in directory: C:\Users\proneon267\AppData\Local\Temp\pip-ephem-wheel-cache-r1fey72j\wheels\dd\19\2d\f8240b4a13759704c1b4ffcd79f0092b5cd0b57a5347e6deda
Successfully built toga-core toga-winforms
Failed to build pillow
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pillow)
Installing dev requirements... errored

Unable to install requirements. This may be because one of your
requirements is invalid, or because pip was unable to connect
to the PyPI server.

Log saved to E:\toga\testbed\logs\briefcase.2024_10_06-04_42_00.dev.log

Expected behavior

Briefcase should be able to install the dependency on python 3.12.

Screenshots

No response

Environment

  • Operating System: Windows 11
  • Python version: 3.12
  • Software versions:
    • Briefcase: 0.3.19
    • Toga: latest main branch
    • ...

Logs

briefcase.2024_10_06-04_42_00.dev.log

Additional context

python-pillow/Pillow#6941 (comment)

However, the Pillow dependency error is not encountered, when toga is installed by:

pip install -e ./core[dev] -e ./dummy -e ./winforms
@proneon267 proneon267 added the bug A crash or error in behavior. label Oct 6, 2024
@freakboy3742 freakboy3742 added good first issue Is this your first time contributing? This could be a good place to start! documentation An improvement required in the project's documentation. labels Oct 6, 2024
@freakboy3742
Copy link
Member

This is a known limitation/constraint of testbed. The dependencies have been specifically selected to work on the Python 3.10 runtime environment; they won't necessarily be available on other versions of Python. macOS and GTK are often able to work around this and compile libraries on the fly; this isn't the case for Windows, Android and iOS.

We can't currently restrict Briefcase to only run on a specific version of Python - the PEP 621 requires-python setting exists for this purpose, so it would make sense to honor it. I've opened beeware/briefcase#2016 to track this idea. However, even if it isn't honored, we can add the definition to the project configuration in anticipation of a time when it is.

In the meantime, the documentation doesn't currently describe the Python version limitation for testbed.

@proneon267
Copy link
Contributor Author

I agree requires-python will make it more clear for why the app cannot run on other python versions.

@rmartin16
Copy link
Member

Did #2497 actually end up resolving this?

@freakboy3742
Copy link
Member

It fulfils the "it should be documented" requirement; #2296 covers the "we need to update Pillow" requirement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A crash or error in behavior. documentation An improvement required in the project's documentation. good first issue Is this your first time contributing? This could be a good place to start!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants