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

uvx and uv run not equivalent? uvx fails resolving tool dependencies #10695

Closed
maphew opened this issue Jan 16, 2025 · 4 comments
Closed

uvx and uv run not equivalent? uvx fails resolving tool dependencies #10695

maphew opened this issue Jan 16, 2025 · 4 comments
Labels
question Asking for clarification or support

Comments

@maphew
Copy link

maphew commented Jan 16, 2025

On windows in CMD prompt or Powershell with "uv 0.5.20 (1c17662 2025-01-15)" I get the below:

foobar.py:

# /// script
# requires-python = ">=3.12"
# dependencies = [
#     "click",
#     "rich",
# ]
# ///
print('Hello')

Fails:

D:\x
λ uvx foobar.py
  x No solution found when resolving tool dependencies:
  `-> Because foobar-py was not found in the package registry and you require foobar-py, we can conclude that your requirements are unsatisfiable.

Works:

D:\x
λ uv run foobar.py
Hello
@zanieb
Copy link
Member

zanieb commented Jan 16, 2025

@zanieb zanieb added the question Asking for clarification or support label Jan 16, 2025
@maphew
Copy link
Author

maphew commented Jan 20, 2025

Thanks zanieb. I was keying off another Astral page that said the uvx was an identical alias to uv run. I'll re-open if/when I find the page with the wrong info.

@maphew maphew closed this as completed Jan 20, 2025
@maphew
Copy link
Author

maphew commented Jan 20, 2025

...it must not have been an Astral page. Somehow I completely missed the concept of tool, and it's quite clear that's a fundamental idea that's been around for awhile. Apologies for the noise!

A small mark in my defense, the error message doesn't give much to go on. For example the OP script does not "require foo-py" and I do not see anything in the pages referenced above that talks about that (admittedly, I skimmed).

@zanieb
Copy link
Member

zanieb commented Jan 20, 2025

We can add a hint to the error here #10784

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

No branches or pull requests

2 participants