Show HN: Uv-pack – Pack a uv environment for later portable (offline) install(github.com)
github.com
Show HN: Uv-pack – Pack a uv environment for later portable (offline) install
https://github.com/davnn/uv-pack
4 comments
Just for the record, "uv environments" are ordinary Python virtual environments, and aside from the "optional portable Python interpreter" they are already contained within a single top-level directory. If just copying that folder wasn't working for you, that's because of absolute paths (in shebangs added to wrapper scripts, in the activation script, and maybe in `pyvenv.cfg` or something like that). Your approach avoids that by giving uv the data required to re-create the environment at the destination. (There have been many tools like this in the past and there's nothing fundamentally wrong with the idea.)
I would say uv provides quite a lot of additional features that can be used in various ways to create plain-old venvs. Note, however that uv-pack can also pack a subset of your uv-monorepo for a specific package (there are still some quirks I have to admit..).
My experience was that it‘s surprisingly painful to „just copy“ a venv and especially a uv-created venv. There are a lot of paths to be modified to get the venv working. Copying a venv felt hacky and wrong, that‘s why I built the tool :)
My experience was that it‘s surprisingly painful to „just copy“ a venv and especially a uv-created venv. There are a lot of paths to be modified to get the venv working. Copying a venv felt hacky and wrong, that‘s why I built the tool :)
uv-pack should make this task less frustrating. It bundles a locked uv environment into a single directory that installs fully offline—dependencies, local packages, and optionally a portable Python interpreter. Copy it over, run one script, and you get the exact same environment every time.
Just released, would love some feedback!