uv: Unable to run tool without "installing"

Summary

I recently found out you could run a tool with uvx without “installing” the tool. So I gave it a try and it didn’t work. So I tried the pycowsay example here, and had the same problem. It works fine though if I do a regular install of the tool.

If this is a bug, I can try to help track it down. But I want to make sure I’m not just misundertstanding this feature or making a mistake somewhere.

This is what happens (verbose output further down):

$ cd /private/var/tmp ; mkdir empty ; cd empty
$ uvx pycowsay hello from uv
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/pycowsay: line 2: /private/var/tmp/empty/--
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/python: No such file or directory
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/pycowsay: line 2: exec: /private/var/tmp/empty/--
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/python: cannot execute: No such file or directory

The uvx pycowsay hello from uv line is the example from the docs.

But a regular install, and then using that same command, is fine:

$ uv tool install pycowsay                              
Resolved 1 package in 1ms
Installed 1 package in 9ms
 + pycowsay==0.0.0.2
Installed 1 executable: pycowsay
$ uvx pycowsay hello from uv
/Users/ecpost/.local/share/uv/tools/pycowsay/lib/python3.13/site-packages/pycowsay/main.py:23: SyntaxWarning: invalid escape sequence '\ '
  """

  -------------
< hello from uv >
  -------------
   \   ^__^
    \  (oo)\_______
       (__)\       )\/\
           ||----w |
           ||     ||

And uninstalling reverts back to the original problem:

$ uv tool uninstall pycowsay
Uninstalled 1 executable: pycowsay
$ uvx pycowsay hello from uv
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/pycowsay: line 2: /private/var/tmp/empty/--
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/python: No such file or directory
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/pycowsay: line 2: exec: /private/var/tmp/empty/--
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/python: cannot execute: No such file or directory

I’ve re-installed uv/uvx, following the instructions here, and then installed fresh using the first curl command in the install instructions.

I did have a pre 0.5.0 version before (0.4.26), if that matters. But I removed uv/uvx from ~/.cargo/bin, as instructed before reinstalling.

Verbose output:

$ uvx --verbose pycowsay hello from uv
DEBUG uv 0.5.30 (ddbc6e315 2025-02-10)
DEBUG Searching for default Python interpreter in managed installations or search path
DEBUG Searching for managed installations at `/Users/ecpost/.local/share/uv/python`
DEBUG Found `cpython-3.13.1-macos-x86_64-none` at `/usr/local/bin/python3` (first executable in the search path)
DEBUG Acquired lock for `/Users/ecpost/.local/share/uv/tools`
DEBUG Checking for Python environment at `/Users/ecpost/.local/share/uv/tools/pycowsay`
DEBUG Released lock at `/Users/ecpost/.local/share/uv/tools/.lock`
DEBUG Assessing Python executable as base candidate: /usr/local/opt/python@3.13/bin/python3.13
DEBUG Assessing Python executable as base candidate: /usr/local/opt/python@3.13/Frameworks/Python.framework/Versions/3.13/bin/python3.13
DEBUG Caching via base interpreter: `/usr/local/opt/python@3.13/bin/python3.13`
DEBUG Using request timeout of 30s
DEBUG Solving with installed Python version: 3.13.1
DEBUG Solving with target Python version: >=3.13.1
DEBUG Adding direct dependency: pycowsay*
DEBUG Found fresh response for: https://pypi.org/simple/pycowsay/
DEBUG Searching for a compatible version of pycowsay (*)
DEBUG Selecting: pycowsay==0.0.0.2 [compatible] (pycowsay-0.0.0.2-py3-none-any.whl)
DEBUG Found fresh response for: https://files.pythonhosted.org/packages/eb/bd/17f894b13037499e615048a6daeb9cae28142ee85ce6eb8d24d10504860b/pycowsay-0.0.0.2-py3-none-any.whl.metadata
DEBUG Tried 1 versions: pycowsay 1
DEBUG marker environment resolution took 0.002s
Resolved 1 package in 2ms
DEBUG Checking for Python environment at `/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq`
DEBUG Running `pycowsay hello from uv`
DEBUG Looking at `.dist-info` at: /Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/lib/python3.13/site-packages/pycowsay-0.0.0.2.dist-info
DEBUG Spawned child 24642 in process group 24641
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/pycowsay: line 2: /private/var/tmp/empty/--
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/python: No such file or directory
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/pycowsay: line 2: exec: /private/var/tmp/empty/--
/Users/ecpost/.cache/uv/archive-v0/axtle42DcQM1MtsnlU4uq/bin/python: cannot execute: No such file or directory
DEBUG Command exited with code: 126

Platform

macOS Sequoia 15.3, Intel (Darwin 24.3.0 x86_64)

Version

uv 0.5.30 (installed via curl)

Python version

Python 3.13.1 (installed via brew)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (7 by maintainers)

Most upvoted comments

My sincerest condolences for getting Package Managered.