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

Cryptic error for python -m uv pip compile --python-version x.y.z when using the Windows app store Python app #4522

Closed
ncoghlan opened this issue Jun 25, 2024 · 5 comments · Fixed by #4620
Assignees
Labels
bug Something isn't working error messages Messaging when something goes wrong

Comments

@ncoghlan
Copy link

I am running the PSF's CPython build from the Windows app store in order to benefit from the automatic updates.

This build omits the Python launcher for Windows, so the py --list-paths command isn't available.

This results in a cryptic error when requesting transitive dependency resolution for a Python version other than the one used to invoke uv:

> python -m uv pip compile --python-version 3.11 requirements.in
error: The `py` launcher could not be found.

This arises even if source builds are disabled (so there shouldn't be any need to extract dynamic runtime dependency information from a source build):

> python -m uv pip compile --no-build --python-version 3.11 requirements.in
error: The `py` launcher could not be found.

The actual error in these commands was that the --python command line option to specify the target Python runtime was missing (I had been mislead by testing on Linux, which had used Fedora's python3.11 alternative Python install to satisfy the 3.11 version check - it would actually be handy if there was a --toolchain-preference only-specified option to keep uv from trying to autodiscover Python runtimes).

@charliermarsh
Copy link
Member

This arises even if source builds are disabled (so there shouldn't be any need to extract dynamic runtime dependency information from a source build)

FWIW I don't think this part is that relevant -- we need to query the Python interpreter to extract the platform markers regardless.

@charliermarsh
Copy link
Member

I'm guessing that should be non-fatal or something but defer to @zanieb who owns Python discovery.

@ncoghlan
Copy link
Author

FWIW I don't think this part is that relevant -- we need to query the Python interpreter to extract the platform markers regardless.

That's a fair point, so I think that just becomes a small comment on the README.md text about Python discovery (it gives slightly misleading info on why uv needs a target Python with the right version available)

@zanieb zanieb self-assigned this Jun 25, 2024
@zanieb zanieb added bug Something isn't working error messages Messaging when something goes wrong labels Jun 25, 2024
@zanieb
Copy link
Member

zanieb commented Jun 25, 2024

We're in the process of rewriting all that documentation. I'll improve that and add more context to that error message, thanks!

@zanieb
Copy link
Member

zanieb commented Jun 28, 2024

I put up a fix at #4620, let me know if you get a chance to test it.

@ncoghlan Regarding

--toolchain-preference only-specified option to keep uv from trying to autodiscover Python runtimes).

In this case, you'd expect us to error whenever --python wasn't included?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants