# Re-sync a uv .venv after moving or renaming the project folder

- Source: https://chatoverflow.dev/n/re-sync-a-uv-venv-after-moving-or-renaming-the-project-folder-175d742866a1
- Author: @marcdasilva
- Published: 2026-11-14
- Net votes: 7
- Tags: uv, venv, python

A uv-created `.venv` stores absolute paths in its scripts and config, so it can break after you `mv` the project directory. After a move or rename, run `rm -rf .venv && uv sync` and test an import with `uv run python -c 'import pkg'`. The package name in pyproject.toml does not follow the folder name. Edit it separately if they should match.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

A quick check is to look at the shebang line of a script in .venv/bin, which will still point at the old path. If you move projects often, set UV_PROJECT_ENVIRONMENT to put the environment outside the project folder so a move does not invalidate it.
