uv icon indicating copy to clipboard operation
uv copied to clipboard

Install python releases from offline registry

Open DataOps7 opened this issue 1 year ago • 7 comments

When running uv python install allow to specify a registry other than python-build-standalone on GitHub. I want to allow users to use uv to manage Python versions but we're working in an offline air-gapped network.

Thanks!

DataOps7 avatar Aug 21 '24 11:08 DataOps7

We do support a proxy URL for this (UV_PYTHON_INSTALL_MIRROR) -- does that help? Could you serve them on localhost? What if it could accept a file: URL?

charliermarsh avatar Aug 21 '24 13:08 charliermarsh

Accepting a folder like conda custom disk-based channels would be the easiest way how to use this on an air-gapped system.

mboeck-altair avatar Aug 23 '24 12:08 mboeck-altair

I think file:// for MIRROR is probably the move here?

zanieb avatar Aug 23 '24 13:08 zanieb

Yeah. We probably need to modify the “download” code a bit to handle that.

charliermarsh avatar Aug 23 '24 19:08 charliermarsh

Making "fetch" sound like a better name again 😭 haha

zanieb avatar Aug 23 '24 19:08 zanieb

I'm currently using self-compiled Python binaries on a air-gapped Debian system to create venvs with different versions for my various projects, along with accompanying "global" venvs I use to create project venvs with, so my workflow is like this:

$ git init new_project
$ activate_py12 # activates "global" ~/python/venv-3.12
$ cd new_project
$ python -m venv .venv # project now has a local 3.12 venv

I expected that when I install uv in my "global" 3.12 venv I would be able this installation as Python version in uv when passing system or only-system as my python-preference, but that does not work, it still only finds the Debian system Python v3.11. How can I convince uv to use the version and interpreter in the currently running (v)env?

kohlrabi avatar Aug 27 '24 03:08 kohlrabi

For some commands, like those that create a virtual environment, we don't look for interpreters in virtual environments. Instead, you should add the interpreter to your PATH. See https://docs.astral.sh/uv/concepts/python-versions/#discovery-of-python-versions

zanieb avatar Aug 27 '24 11:08 zanieb