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

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 #10464

Open
jamesdeluk opened this issue Jan 10, 2025 · 5 comments

Comments

@jamesdeluk
Copy link

New to uv, sorry if PEBKAC.

I'm trying to install pycaret (uv add pycaret) to a new project on Windows, Python 3.11.

Get 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

The repo (https://pypi.org/simple/kaleido/) has:

kaleido-0.2.1-py2.py3-none-win_amd64.whl
kaleido-0.2.1.post1-py2.py3-none-manylinux2014_armv7l.whl

So, no kaleido-0.2.1.post1 for Windows.

Checking the PyPi website, there is https://pypi.org/project/kaleido/0.2.1.post1/

pip install kaleido==0.2.1.post1

Although that applies to the manylinux version.

Yet using conda, it works fine; it installs:

Downloading kaleido-0.2.1-py2.py3-none-win_amd64.whl (65.9 MB)

Is there a way for uv to use the compatible version like conda does?

@konstin
Copy link
Member

konstin commented Jan 10, 2025

The problem is that kaleido 0.2.1 and 0.2.1.post1 are technically different versions, and the latter has only a kaleido-0.2.1.post1-py2.py3-none-manylinux2014_armv7l.whl (and due to universal resolution, uv doesn't know which wheels it will need eventually). Setting required platforms is planned in #10067, currently you can try something like

[tool.uv]
environments = [
	"platform_system != "Windows",
	"platform_system == "Windows"
]

or banning 0.2.1.post1 in a constraint.

@jamesdeluk
Copy link
Author

jamesdeluk commented Jan 10, 2025

Thanks @konstin .

[tool.uv]
environments = [
	"platform_system != "Windows",
	"platform_system == "Windows"
]

The same error occurred with this (note it's "platform_system != 'Windows'" not "platform_system != "Windows" for anyone else who tried this and initially had an error).

or banning 0.2.1.post1 in a constraint.

How can I do this?

EDIT: I tried

dependencies = ["kaleido<0.2.1.post1"]

But then got a weird error:

  × Failed to build `sklearn==0.0.post12`
The 'sklearn' PyPI package is deprecated, use 'scikit-learn'

sklearn 0.0.post12 is ancient!

dependencies = ["kaleido<=0.2.1"]

Seems to be working, but it's taking ages to install - far longer than both pip and conda, making me think something isn't working correctly (warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.)

@konstin
Copy link
Member

konstin commented Jan 10, 2025

With this input:

[project]
name = "foo"
version = "0.1.0"
requires-python = ">=3.11"
dependencies = [
  "pycaret",
]

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

I get a resolution that does not contain sklearn==0.0.post12 and - at least on linux python 3.11 - successfully installs.

Seems to be working, but it's taking ages to install - far longer than both pip and conda, making me think something isn't working correctly (warning: Failed to hardlink files; falling back to full copy. This may lead to degraded performance.)

This usually happens when the cache and the install directory aren't on the same drive, but should not have a massive impact. Usually, something really is some package not having a wheel for the target environment, and that build takes a long time. You can get more information running with -v.

@jamesdeluk
Copy link
Author

With this input:

To confirm, you mean edit the toml then uv add pycaret? I did that and it seems to have worked - thanks! Or is there a way to "run" the toml directly, similar to building from a requirements file?

This usually happens when the cache and the install directory aren't on the same drive, but should not have a massive impact. Usually, something really is some package not having a wheel for the target environment, and that build takes a long time. You can get more information running with -v.

Turns out it was because I was working within Google Drive, so it was the annoying upload/download causing the delay.

@konstin
Copy link
Member

konstin commented Jan 13, 2025

Inside of docker run --rm -it -v $(pwd):/io ghcr.io/astral-sh/uv:python3.11-bookworm bash, i can create a pyproject.toml with:

[project]
name = "foo"
version = "0.1.0"
requires-python = ">=3.11"

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

and run

uv add pycaret

I get a lockfile with sklearn-compat 0.1.3, but no sklearn==0.0.post12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants