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

uv add pyqt5 error #7005

Closed
rainzee opened this issue Sep 4, 2024 · 6 comments
Closed

uv add pyqt5 error #7005

rainzee opened this issue Sep 4, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@rainzee
Copy link

rainzee commented Sep 4, 2024

uv pip install pyqt5 works perfectly
but uv add pyqt5 result error:

❯ uv add pyqt5
Resolved 4 packages in 2.78s
error: distribution pyqt5-qt5==5.15.14 @ registry+https://pypi.org/simple can't be installed because it doesn't have a source distribution or wheel for the current platform

uv version uv 0.4.4 (3d75df6ab 2024-09-04)
os windows 10

@rainzee
Copy link
Author

rainzee commented Sep 4, 2024

I did some digging and found that pyqt5 depends on a package called pyqt5-qt5 which does not support Windows in versions 5.15.11 - 5.15.14, but does support Windows in 5.15.2.

In this case, how to lock dependencies across platforms? In other words, how to avoid errors, after all, there is no problem with normal installation.

@charliermarsh
Copy link
Member

This is an inherent problem with distributions that don't ship source distributions, and have limited platform support. We can't guarantee that the set of wheels will cover all the platforms you care about. I'd suggest adding a constraint like:

[tool.uv]
constraint-dependencies = ["pyqt5-qt5 <=5.15.2"]

@charliermarsh
Copy link
Member

It's the same problem as #5182, so gonna merge in there.

@charliermarsh charliermarsh closed this as not planned Won't fix, can't repro, duplicate, stale Sep 4, 2024
@charliermarsh charliermarsh added the bug Something isn't working label Sep 4, 2024
@rainzee
Copy link
Author

rainzee commented Sep 5, 2024

So, is this a bug or expected behavior? I tried multiple different package managers(poetry and pdm) and all went wrong, but I felt we could do better, after all, this distribution pattern exists for many popular libraries, so how do we lock down dependencies?

@adam-grant-hendry
Copy link

This is an inherent problem with distributions that don't ship source distributions, and have limited platform support. We can't guarantee that the set of wheels will cover all the platforms you care about. I'd suggest adding a constraint like:

[tool.uv]
constraint-dependencies = ["pyqt5-qt5 <=5.15.2"]

Since this is a Windows-only issue, wouldn't it be better to do this?

deps = [
    "pyqt5>=5.15.11; sys_platform != 'win32'",
    "pyqt5<=5.15.2; sys_platform == 'win32'"
]

@adam-grant-hendry
Copy link

Note: pyside2 is also not available for python >= 3.11 (PyPI-PySide2)

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

Successfully merging a pull request may close this issue.

3 participants