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

Can't install pypi package dtale #7703

Open
kjyv opened this issue Sep 26, 2024 · 2 comments
Open

Can't install pypi package dtale #7703

kjyv opened this issue Sep 26, 2024 · 2 comments
Labels
error messages Messaging when something goes wrong

Comments

@kjyv
Copy link

kjyv commented Sep 26, 2024

Hey there,
I'm trying to install dtale with a simple pyproject.toml running uv sync (.venv deleted, .cache/uv deleted). Even if it is the only package, I see this error:
error: distribution kaleido==0.2.1.post1 @ registry+https://pypi.org/simple can't be installed because it doesn't have a source distribution or wheel for the current platform

Installing with uv pip install dtale work fine though and the same package combination works well with pipenv.
I'm on macOS 15.0, uv 0.4.16.

@konstin
Copy link
Member

konstin commented Sep 26, 2024

This is caused by a difference in how uv sync and uv pip install handle unavailable wheel. The tl;dr fix for you problem is adding the following to your pyproject.toml:

[tool.uv]
constraint-dependencies = ["kaleido!=0.2.1.post1"]

The longer explanation: There are two recent versions of dtale, 0.2.1 and 0.2.1.post1. The former has a source distribution and wheels for all sorts of platforms (https://pypi.org/project/kaleido/0.2.1/#files), the latter only has an armv7l wheel for linux (https://pypi.org/project/kaleido/0.2.1.post1/#files); I think the authors wanted to add the missing wheel to the release, but instead created a new release. When using uv pip install, the resolver skips over 0.2.1.post1 because it wants to find something that works for the current platform and uses 0.2.1 instead. uv sync on the other hand attempts a universal resolution that is the same independent from which platform you run it, so it can't skip releases due to missing source distributions or platforms. It then locks 0.2.1.post1 and subsequently fails to install. The constraint we're adding says that if the resolver is trying to pick a version for kaleido, it should skip that post-release, but without making kaleido a dependency of your project.

@konstin konstin added the question Asking for clarification or support label Sep 26, 2024
@kjyv
Copy link
Author

kjyv commented Sep 26, 2024

Ok, thank you for the detailed explanation. So the contraint fixes our problem but I guess it's not ideal if users like me run into this and the error message is not saying much about how to go forward. Rather than changing the resolver for the sync which I guess is tricky for all platforms with such packages, could this case be detected by uv and a more specific error message shown?

@charliermarsh charliermarsh added error messages Messaging when something goes wrong and removed question Asking for clarification or support labels Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

No branches or pull requests

3 participants