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
Pillow should require NumPy >= 1.23 #6588
Comments
Just for context, the reason you are specifying Pillow 9.2.0 is because of #6394. Can I ask, what is it that lead you to update Pillow to the latest version, but not NumPy? |
I'm not entirely sure which dependency caused it, but this was the result when I installed my package with pip. I assume one of my other dependencies defaulted to an older NumPy version, but I'm not sure which one. I'm still digging through to figure out a self consistent setup. Regardless, in principle there doesn't have to be a particular reason - somebody could have an older NumPy installed already but no Pillow, and then run |
NumPy is an optional dependency of Pillow. Performing a quick Google search, I don't think that an optional dependency can have a minimum version. Correct me if I missed something. I then considered the possibility of raising an error if NumPy is too old in So I don't think that b) is possible. As for a), keeping the workaround, I'm not keen on introducing a change (#5379), reverting that change (#6394), and then re-introducing it... I think that's off-putting to users, who would prefer a consistent experience - whether or not an error is raised is not the only difference. See #6581. What if we instead raised a warning when an error is triggered with older NumPy versions? I've created PR #6594 for this. |
Ah, I see. That makes sense to me, thank you! |
What did you do?
I opened a truncated image file and converted it to an array to check the validity of the file. (The equivalent of this test, though my file was a tiff.)
What did you expect to happen?
OSError
What actually happened?
It returned an actual array. I didn't imshow it to see what was in the place of the missing bytes.
What are your OS, Python and Pillow versions?
I think it would be better to either (a) keep the workaround for old numpy versions or (b) require a numpy version that works in setup.py. The current setup is not self consistent.
The text was updated successfully, but these errors were encountered: