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

10.0.0 refused to build on Windows with 32-bit Python #7251

Closed
baaziznasser opened this issue Jul 2, 2023 · 23 comments
Closed

10.0.0 refused to build on Windows with 32-bit Python #7251

baaziznasser opened this issue Jul 2, 2023 · 23 comments
Labels
Installation Usually a problem with … Windows

Comments

@baaziznasser
Copy link

baaziznasser commented Jul 2, 2023

hello the pillow lib refused to install on windows python 3.11 x32
here is the error

    File "<string>", line 1005, in <module>
  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


  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pillow
Failed to build pillow
ERROR: Could not build wheels for pillow, which is required to install pyproject.toml-based projects

C:\Users\nacer baaziz><!--

What are your OS, Python and Pillow versions?

  • OS: windows 11
  • Python: python 3.11 x32
  • Pillow: 10.0.0
@baaziznasser
Copy link
Author

the wheel of python 3.11 x32 is not exist

@radarhere
Copy link
Member

Hi. You will read in the release notes that it was a deliberate decision to not provide 32-bit wheels any longer.

#6941 (comment)

I suggest we drop all the 32-bit wheels... If there's a lot of demand or very good reason, we can always add something back (e.g. 3.8 on Windows has a slightly larger percentage).

While we are no longer providing 32-bit wheels though, you can still build from source. See https://pillow.readthedocs.io/en/stable/installation.html#building-from-source

@radarhere radarhere added Windows Installation Usually a problem with … labels Jul 2, 2023
@robgom
Copy link

robgom commented Jul 3, 2023

The problem is that when installing pillow, newer version (10.x) with tar.gz is preferred over the older wheel.
And newer version can't be built on 32 bits, so several people could be affected by this.

@radarhere
Copy link
Member

You can select only versions of Pillow with a wheel when installing by using python3 -m pip install Pillow --only-binary=:all:

@robgom
Copy link

robgom commented Jul 3, 2023

Thank you, @radarhere , but that might be not scalable. The pillow package is rarely used directly, it is rather an indirect dependency. Other packages can be involved, for which tar.gz would be needed.
Just trying to chime in, providing arguments to consider providing wheels or not announcing 32 bit support in first place.

@homm
Copy link
Member

homm commented Jul 3, 2023

@robgom You don't need list Pillow directly to use --only-binary=:all: option

@robgom
Copy link

robgom commented Jul 3, 2023

@homm yes, I know. My point was that including this option could have bigger implications. That's what it'd have to look like:

--only-binary=:all:  # workaround for pillow dependency

matplotlib
yaml
whatever
  1. Repeated for several dependency/requirements files used for different processes.
  2. Expressing implicit dependency version restriction
  3. Potentially conflicting with any other package requiring source, not binary

Do those arguments make sense to you?
Again, I can follow your advice, just trying to suggest to solve the issue closer to its roots.

@radarhere
Copy link
Member

providing arguments to consider providing wheels or not announcing 32 bit support in first place

I don't understand the meaning of 'not announcing 32 bit support in first place'. Perhaps these words aren't quite correct, because this was announced.

If you just want to say that you're a 32-bit user, and wheels make your life easier, mission accomplished - I don't think we're trying to tell you that dropping 32-bit wheels has zero effect. If a flood of other people also chime in and say that they want 32-bit wheels, then those voices and your voice will make us reconsider this.

Potentially conflicting with any other package requiring source, not binary

If you're concerned about packages that do not provide wheels, there is also --prefer-binary - https://pip.pypa.io/en/stable/cli/pip_install/#cmdoption-prefer-binary

In your example, you mention matplotlib. I realise you might say that was just an example, but matplotlib has actually also decided to drop 32-bit wheels moving forward.

matplotlib/matplotlib#25811 (comment)

On main we no longer build 32 bit wheels and will not publish them in the future.

@robgom
Copy link

robgom commented Jul 3, 2023

providing arguments to consider providing wheels or not announcing 32 bit support in first place

I don't understand the meaning of 'not announcing 32 bit support in first place'. Perhaps these words aren't quite correct, because this was announced.

I'm sorry for selecting potentially not the best words.
You're right, the change was announced.
I was thinking from a technical perspective - the package somehow indicating in its data that it's not supporting 32 bits (in its metadata).
That way it wouldn't be picked up by pip in first place.
And users wanting to rebuild 32-bit version would potentially have an additional step to do it.

I'm not sure if and how it's doable, so probably stop at this point.
Provided my comments so far, because we've been affected by this change, and while I think I support it, I hope that the flow can be improved.

@radarhere
Copy link
Member

@baaziznasser do you have any further questions?

@homm
Copy link
Member

homm commented Jul 3, 2023

somehow indicating in its data that it's not supporting 32 bits (in its metadata).

It’s not the case. Wheels are not provided, which doesn’t mean that you can’t install it at all.

There are could be a dozen of reasons why provided wheels does not suits you. It’s more correct to say that there is always only tiny intersection of factors (OS vendor, OS version, core libraries, platform, bitness) when you can find wheels. And of course Pillow provides a list of this intersections: it's a list of the wheels itself.

@jamesbraza
Copy link

I am hitting this as well. See here for relevant discussion: pypa/setuptools#3746

@radarhere
Copy link
Member

For a summary of that other issue, the user suggests that setuptools allow packages to require 32-bit support.

That discussion has another offshoot in https://discuss.python.org/t/idea-enforcing-32-bit-vs-64-bit-support-in-setuptools/29040, where so far, a CPython core developer questions why this would be relevant to packages that still support 32-bit, but have merely stopped distributing 32-bit wheels (like we have).

@radarhere radarhere changed the title 10.0.0 refused to build on windows with python 3.11 32 bit 10.0.0 refused to build on Windows with 32-bit Python Jul 6, 2023
@xqt
Copy link

xqt commented Jul 6, 2023

We have the same issue with Python 3.8 and Python 3.10 on 32-bit system:
https://ci.appveyor.com/project/pywikibot-core/pywikibot/builds/47477816

@radarhere
Copy link
Member

radarhere commented Jul 6, 2023

@xqt we are no longer providing 32-bit wheels, so your code is trying to install Pillow from source. The error is telling you that you are missing a dependency. See https://pillow.readthedocs.io/en/stable/installation.html#building-from-source for instructions about how to build Pillow from source.

@xqt
Copy link

xqt commented Jul 6, 2023

@radarhere: Pillow is a requirement of the Pywikibot framework and we are running 32/64-bit tests on Appveyor. But CI tests are only one side. What is the solution for bot owners having Python 3.8+ on 32-bit? We could require Pillow < 10.0.0 for a while but this cannot be the way to go.

@radarhere
Copy link
Member

radarhere commented Jul 6, 2023

Do you mean that it is not just a matter of you installing Pillow, but also your users? They too could install Pillow from source. It would be the hope that because 32-bit use is fading, that this only affects a small portion of users. If you find a large number of users struggling with this, you can ask your users to come here and encourage us to restore 32-bit wheels.

#6941 (comment)

I suggest we drop all the 32-bit wheels... If there's a lot of demand or very good reason, we can always add something back (e.g. 3.8 on Windows has a slightly larger percentage).

@hugovk
Copy link
Member

hugovk commented Jul 6, 2023

Using https://github.com/ofek/pypinfo to get downloads numbers for Pywikibot from PyPI over the last week, I only see a single download for 32-bit (armv7l, 0.06%), the other 1,732 are 64-bit (99.94%):

$ pypinfo --days 7 --limit 1000 --percent pywikibot version cpu
Served from cache: False
Data processed: 281.80 MiB
Data billed: 282.00 MiB
Estimated cost: $0.01

| version      | cpu     | percent | download_count |
| ------------ | ------- | ------- | -------------- |
| 8.1.2        | x86_64  |  55.57% |            963 |
| 7.0.0        | x86_64  |  20.31% |            352 |
| 6.1.0        | x86_64  |   8.77% |            152 |
| 6.6.5        | x86_64  |   5.19% |             90 |
| 8.1.2        | AMD64   |   1.90% |             33 |
| 8.2.0        | x86_64  |   1.44% |             25 |
| 6.6.0        | x86_64  |   1.27% |             22 |
| 6.6.3        | x86_64  |   1.15% |             20 |
| 8.0.1        | x86_64  |   0.75% |             13 |
| 7.1.0        | x86_64  |   0.46% |              8 |
| 7.6.0        | x86_64  |   0.46% |              8 |
| 7.7.3        | x86_64  |   0.40% |              7 |
| 6.6.1        | x86_64  |   0.29% |              5 |
| 6.0.1        | x86_64  |   0.29% |              5 |
| 8.1.0        | x86_64  |   0.23% |              4 |
| 8.1.2        | aarch64 |   0.23% |              4 |
| 8.1.2        | arm64   |   0.17% |              3 |
| 8.0.2        | x86_64  |   0.12% |              2 |
| 6.6.5        | AMD64   |   0.12% |              2 |
| 6.4.0        | x86_64  |   0.12% |              2 |
| 7.7.3        | aarch64 |   0.12% |              2 |
| 6.6.5        | arm64   |   0.06% |              1 |
| 3.0.20200609 | x86_64  |   0.06% |              1 |
| 6.5.0        | AMD64   |   0.06% |              1 |
| 8.2.0        | AMD64   |   0.06% |              1 |
| 6.6.1        | AMD64   |   0.06% |              1 |
| 7.7.1        | x86_64  |   0.06% |              1 |
| 8.2.0        | armv7l  |   0.06% |              1 |
| 4.3.0        | AMD64   |   0.06% |              1 |
| 8.0.2        | AMD64   |   0.06% |              1 |
| 5.6.0        | x86_64  |   0.06% |              1 |
| 6.6.3        | AMD64   |   0.06% |              1 |
| Total        |         |         |          1,733 |

@jamesbraza
Copy link

For a summary of that other issue, the user suggests that setuptools allow packages to require 32-bit support.

Just to follow up on this, @radarhere I think you misinterpreted in your summary post, it's wasn't about requiring 32-bit support. It was about enabling pip to automatically discern 32-bit systems' should fall back on Pillow version 9, by packages adding metadata on supported platforms.

Anyways, the idea kind of sizzled out 🤷‍♂️, as stating supported platform(s) isn't feasible in practice. For example, perhaps win32 actually has zlib, so source build would've worked.

@nulano
Copy link
Contributor

nulano commented Jul 6, 2023

I only see a single download for 32-bit (armv7l, 0.06%)

Worth noting that this is ARM, not x86, so the wheel would not have been compatible anyway.

@radarhere
Copy link
Member

It's now been a month since the release of Pillow 10.0.0.

In the first week, we had some feedback here about the absence of 32-bit wheels here, and a comment in the release issue, but no new users have added feedback since.

If there is further feedback, we can reconsider 32-bit wheels, but for the moment, no users here have active questions about how to install Pillow, so I'm closing this.

@radarhere
Copy link
Member

#7580 has been merged, so Windows 32-bit wheels should be available again when Pillow 10.2.0 is released on January 2.

@radarhere
Copy link
Member

Pillow 10.2.0 has been released with Windows 32-bit wheels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Installation Usually a problem with … Windows
Projects
None yet
Development

No branches or pull requests

8 participants