Skip to content

Local drive environment install with project on network drive #8738

@marcelroed

Description

@marcelroed

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:

  1. Place your project on the network drive
  2. Create a symlink from <project-dir>/.venv/ to a directory on the local drive. The local path will be consistent across every machine.
  3. Instantiate an empty virtualenv in that local directory on the machine you want to use. This needs to be repeated on each machine.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionAsking for clarification or support

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions