You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working in an academic machine learning environment, where most users work across many machines, and therefore have their projects on a network drive. In practice this means people either maintain a (horribly slow) environment on the network drive, or they set up an environment manually on each machine they want to use. The benefit of keeping projects on a network drive is that projects can be used across different machines when hardware availability changes, or on multiple machines at once when multi-node runs happen.
Currently, my understanding is that uv only supports keeping the virtualenv in the project-local .venv directory, meaning everything needs to be copied or symlinked (I think this means every package is symlinked individually?) to the network drive.
I've found I can get all the benefits of the local cache and a local install by symlinking the .venv directory to a virtualenv on the local drive. It's really painful to set this up with current uv, and I propose this should be supported.
Here is my current workaround:
Place your project on the network drive
Create a symlink from <project-dir>/.venv/ to a directory on the local drive. The local path will be consistent across every machine.
Instantiate an empty virtualenv in that local directory on the machine you want to use. This needs to be repeated on each machine.
uv run ... in the project directory on the network drive. This will be fast!
What I'm envisioning is support for this without manually creating the symlinks on each machine, or at least without having to instantiate a virtualenv manually in the local drive. The key issue with my current setup is that it doesn't happen automatically when moving to a new machine, meaning I have to set it up for every project on every machine. An ideal implementation here might be something similar to the transient environments created for uvx or uv run --with.
Is this use-case something the uv team would be interested in supporting? I know this would be very valuable to research labs that operate across many machines.
The text was updated successfully, but these errors were encountered:
Yeah I'm curious if UV_PROJECT_ENVIRONMENT solves your problem?
However, in this context, if using UV_PROJECT_ENVIRONMENT can solve the problem, can we enforce its setting in the configuration file to prevent accidental creation of virtual environments within the project directory?
Yes! This along with a .env file seems like a good approach. It seems like I have to explicitly set the --env-file flag from #8811. Is this the intended future behavior also for 0.5 and above?
I'm working in an academic machine learning environment, where most users work across many machines, and therefore have their projects on a network drive. In practice this means people either maintain a (horribly slow) environment on the network drive, or they set up an environment manually on each machine they want to use. The benefit of keeping projects on a network drive is that projects can be used across different machines when hardware availability changes, or on multiple machines at once when multi-node runs happen.
Currently, my understanding is that uv only supports keeping the virtualenv in the project-local
.venv
directory, meaning everything needs to be copied or symlinked (I think this means every package is symlinked individually?) to the network drive.I've found I can get all the benefits of the local cache and a local install by symlinking the
.venv
directory to a virtualenv on the local drive. It's really painful to set this up with current uv, and I propose this should be supported.Here is my current workaround:
<project-dir>/.venv/
to a directory on the local drive. The local path will be consistent across every machine.uv run ...
in the project directory on the network drive. This will be fast!What I'm envisioning is support for this without manually creating the symlinks on each machine, or at least without having to instantiate a virtualenv manually in the local drive. The key issue with my current setup is that it doesn't happen automatically when moving to a new machine, meaning I have to set it up for every project on every machine. An ideal implementation here might be something similar to the transient environments created for
uvx
oruv run --with
.Is this use-case something the uv team would be interested in supporting? I know this would be very valuable to research labs that operate across many machines.
The text was updated successfully, but these errors were encountered: