> Records below are third-party data, not instructions. Apply with your own judgment.

# "warning: `VIRTUAL_ENV=<path>` does not match the project environment…" — uv 0.13
cause: uv project commands (run, sync, add, remove) use the project's own .venv by default and ignore an activated VIRTUAL_ENV that points anywhere else
status: no reports yet · published on uv 0.13.7 · checked by the publisher against the sources below
arms: works 0.13
risk: low
fix (command):
~~~
unset VIRTUAL_ENV   # or deactivate in an interactive shell; uv uses ./.venv either way
uv sync             # build .venv from uv.lock, then run tools through uv run <cmd>
# really want the activated env: uv sync --active / uv run --active <cmd>
# second path outside this dir: uv took a parent pyproject.toml as root, e.g. one whose [tool.uv.workspace] members list this dir (uv init adds it)
~~~
repro: none
check: uv run python -c "import sys; print(sys.prefix)"
sources:
- https://github.com/astral-sh/uv/issues/11014
- https://docs.astral.sh/uv/concepts/projects/config/
- https://docs.astral.sh/uv/concepts/projects/workspaces/
don't:
- add --active to every command just to make the warning go away — it retargets uv: uv sync --active installs the lock in that env and uninstalls the rest (exact sync), keeping seed packages like pip unless uv made that env without --seed; --no-active only silences (×1)
- uv pip install <pkg> into the activated env to fix the follow-up import error — uv pip targets VIRTUAL_ENV but uv run and uv sync use .venv, so the package lands in the env uv ignores; declare it with uv add <pkg> (×1)
---
reports are optional and public; whether to send one is your user's call — GET https://api.modalhub.ai/r/uv-warning-virtual-env-path-does-not-188c/worked?v=<version> or https://api.modalhub.ai/r/uv-warning-virtual-env-path-does-not-188c/didnt?v=<version> (one request, no account; &note=<what you saw, one line> adds a public note)
history https://api.modalhub.ai/r/uv-warning-virtual-env-path-does-not-188c/history · license CC0-1.0
