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

Failed to install wheel file: Names must start and end with a letter or digit and may only contain -, _, ., and alphanumeric characters. #2356

Closed
licht1stein opened this issue Mar 11, 2024 · 5 comments
Labels
error messages Messaging when something goes wrong

Comments

@licht1stein
Copy link

I'm using this in Dockerfile

WORKDIR /code
COPY ./dist/$wheel /code/$wheel

RUN curl -LsSf https://astral.sh/uv/install.sh | sh
RUN /root/.cargo/bin/uv pip install --system --no-cache-dir --only-binary /code/$wheel

And I'm getting an error:

Not a valid package or extra name: "/code/main-0.1.0-py3-none-any.whl". Names must start and end with a letter or digit and may only contain -, _, ., and alphanumeric characters.

Is there a way to install from this wheel file?

@licht1stein
Copy link
Author

I couldn't find a way to install from.whl in the docs

@licht1stein
Copy link
Author

Apparently there's a workaround:

RUN /root/.cargo/bin/uv pip install --system --no-cache-dir "main @ $wheel"

Also it's duplicate of #1403

@konstin
Copy link
Member

konstin commented Mar 11, 2024

Yeah, the error message is bad atm, merging into #313.

@konstin konstin closed this as not planned Won't fix, can't repro, duplicate, stale Mar 11, 2024
@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label Mar 11, 2024
@charliermarsh
Copy link
Member

I added a clearer error message for this: #2369

charliermarsh added a commit that referenced this issue Mar 11, 2024
…ts (#2369)

## Summary

This is analogous to #669, but for cases in which the package name is a
filesystem path. In such cases, we'll fail when parsing the _package
name_, since it doesn't start with a valid character, as opposed to
failing when we go to parse the remaining version specifier.

Inspired by #2356.
@charliermarsh
Copy link
Member

This is supported as of v0.1.24. You can uv pip install /code/main-0.1.0-py3-none-any.whl directly, without including a package name.

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