astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
25.73k stars 750 forks source link

Error installing wheel with "invalid version" #5478

Open albertotb opened 3 months ago

albertotb commented 3 months ago

Version: uv 0.2.29

I'm not sure if this is intended or not:

uv pip install https://huggingface.co/PlanTL-GOB-ES/es_anonimization_core_lg/resolve/main/es_anonimization_core_lg-any-py3-none-any.whl

Fails with

error: The wheel filename "es_anonimization_core_lg-any-py3-none-any.whl" has an invalid version: expected version to start with a number, but no leading ASCII digits were found

However, the equivalent pip command is able to install the wheel:

pip install https://huggingface.co/PlanTL-GOB-ES/es_anonimization_core_lg/resolve/main/es_anonimization_core_lg-any-py3-none-any.whl
Collecting es-anonimization-core-lg==any
  Downloading https://huggingface.co/PlanTL-GOB-ES/es_anonimization_core_lg/resolve/main/es_anonimization_core_lg-any-py3-none-any.whl (587.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 587.8/587.8 MB 1.5 MB/s eta 0:00:00
charliermarsh commented 3 months ago

In our current design this is intentional -- we require that wheels always have valid wheel filenames, and that isn't a valid filename (since it's omitting the version).

charliermarsh commented 3 months ago

We should support this, requires some refactors though.

eth3lbert commented 3 months ago

Version: uv 0.2.29

I'm not sure if this is intended or not:

uv pip install https://huggingface.co/PlanTL-GOB-ES/es_anonimization_core_lg/resolve/main/es_anonimization_core_lg-any-py3-none-any.whl

Fails with

error: The wheel filename "es_anonimization_core_lg-any-py3-none-any.whl" has an invalid version: expected version to start with a number, but no leading ASCII digits were found

However, the equivalent pip command is able to install the wheel:

pip install https://huggingface.co/PlanTL-GOB-ES/es_anonimization_core_lg/resolve/main/es_anonimization_core_lg-any-py3-none-any.whl
Collecting es-anonimization-core-lg==any
  Downloading https://huggingface.co/PlanTL-GOB-ES/es_anonimization_core_lg/resolve/main/es_anonimization_core_lg-any-py3-none-any.whl (587.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 587.8/587.8 MB 1.5 MB/s eta 0:00:00

Apologies for the intrusion. Could you please specify which version of pip you are using?

I have tested this with pip version 24.2 and encountered the following error:

pip install https://huggingface.co/PlanTL-GOB-ES/es_anonimization_core_lg/resolve/main/es_anonimization_core_lg-any-py3-none-any.whl               
ERROR: Invalid requirement: 'es-anonimization-core-lg==any': Expected end or semicolon (after name and no valid version specifier)
    es-anonimization-core-lg==any
albertotb commented 3 months ago

Sure, I'm using pip 24.0, which seems to work fine. I will report to the creator of the wheel to see if they can follow the naming conventions. The confusing part here is that with pip seems to work (at least in some versions), so the wheel mantainers may not have noticed that the naming is incorrect.

albertotb commented 3 months ago

Looking at pip release notes maybe this is related to this issue https://github.com/pypa/pip/issues/12063

It seems that starting with pip 24.1b1 the wheel I used as an example is no longer installable with pip https://pip.pypa.io/en/stable/news/#b1-2024-05-06

jcorrie commented 1 week ago

I'm experiencing the same issue using uv pip to install a spacy model via hugging face. The url given by hugging face for the wheels file seems only (?) to provide "any" as the version number. Agreed with @albertotb that from the pip issue referenced it seems like this is probably something hugging face will need to update. I've open a new issue huggingface/huggingface_hub#2637

albertotb commented 1 week ago

Yes, the workaround I'm using is to stick with pip to install those HuggingFace models and pin pip<=24.0. I guess you could also host a clone of such HuggingFacel models but with the correct naming. That is not ideal if they are being updated regularly, but it's probably fine for most models.

jtauber commented 6 hours ago

can the wheel also be downloaded and renamed?