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

[Bug]: Installation problem: Pillow version not compatible with Python version #715

Closed
3rdPix opened this issue Jan 16, 2024 · 11 comments
Closed
Labels
bug Something isn't working

Comments

@3rdPix
Copy link

3rdPix commented Jan 16, 2024

What happened?

When trying to install with pip install "PyQt6-Fluent-Widgets[full]" -i https://pypi.org/simple/. It finds an error at the very end with the Pillow library. In requirements it is expressed that pillow version should be <=9.4.0... why do you keep that? Is there a backwards compatibility problem with newer versions? In the pillow site its expressed that newer python versions only work with Pillow >= 10.1. See:

image

On this matter, is there a reason you keep pillow in older versions? Could we just use the newer version?

Operation System

Windows 23H2

Python Version

Python 3.12.1

PyQt/PySide Version

PyQt6

PyQt/PySide-Fluent-Widgets Version

1.4.5

How to Reproduce?

During installation

Minimum code

Does not apply.
@3rdPix 3rdPix added the bug Something isn't working label Jan 16, 2024
@3rdPix
Copy link
Author

3rdPix commented Jan 16, 2024

AUTO-UPDATE

I manually installed the latest versions of all the dependencies. Including Pillow and Frameless-Window. There is no need to add version restriction, newer versions will work just fine. This needs to be updated in the setup and requirements files so that it does not cause wheel errors whilst installing fluent widgets.

Here you can see the version list with pip and the fluent window working normally:

image

The main issue was the Pillow package, but again, there is no need to restrict the requirement to older versions. I suggest to change it, and let it install the latest version.

@zhiyiYo
Copy link
Owner

zhiyiYo commented Jan 16, 2024

See #376

@zhiyiYo
Copy link
Owner

zhiyiYo commented Jan 16, 2024

Image.fromqpixmap(QPixmap(image)) will raise an exception if the version of pillow >= 9.4.0 and PyQt <= 5.15.10, maybe I should use another way to convert QPixmap to Image

@3rdPix
Copy link
Author

3rdPix commented Jan 16, 2024

You're right! But in this case I was only referring to PyQt6 branch (where obviously PyQt > 5.15.10)... maybe apply the change only on that deployment?

@zhiyiYo
Copy link
Owner

zhiyiYo commented Jan 16, 2024

Sorry, Image.fromqpixmap(QPixmap(image)) will raise an exception if the version of pillow >= 9.4.0 and PyQt > 5.15.2. PyQt6 has not been tested.

@zhiyiYo
Copy link
Owner

zhiyiYo commented Jan 16, 2024

I checked the source code of PIL, and found that high version PIL only supports PyQt6/PySide6.
image

@zhiyiYo
Copy link
Owner

zhiyiYo commented Jan 16, 2024

But Pillow 9.4.0 supports all Qt bindings. This is weird.
image

This is the deprecate proposal of Pillow: python-pillow/Pillow#6237

@zhiyiYo
Copy link
Owner

zhiyiYo commented Jan 16, 2024

This is the conversion method, I will add it to my repo:
image

@3rdPix
Copy link
Author

3rdPix commented Jan 16, 2024

I was just checking the same! Here you can see the exact commit where they stopped supporting PyQt5:

python-pillow/Pillow@59c9d87
https://github.com/python-pillow/Pillow/commits/main/src/PIL/ImageQt.py

image

I think the solution should be to make a clear differentiation between the PyQt5 and the PyQt6 branch. Modifying the setup.py so that it takes into account that newer versions of Pillow support PyQt6 only instead of PyQt5.

I think that is a better approach than to hard-code by copying the method from Pillow.

@zhiyiYo
Copy link
Owner

zhiyiYo commented Jan 16, 2024

V1.4.6 has removed restrictions on the PIL version

@3rdPix
Copy link
Author

3rdPix commented Jan 16, 2024

Just saw the commit. Installation for PyQt6 now working perfectly with latest version of Pillow:

image

Thanks!

@3rdPix 3rdPix closed this as completed Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants