uv on Windows with OneDrive: Centralized Virtual Environments
If you use uv on Windows and your projects live in OneDrive, you've probably already run into the problem: OneDrive tries to sync the .venv folder and everything breaks — slow sync, locked files, c...

Source: DEV Community
If you use uv on Windows and your projects live in OneDrive, you've probably already run into the problem: OneDrive tries to sync the .venv folder and everything breaks — slow sync, locked files, corrupted environments. The solution is to centralize virtual environments outside of OneDrive and have uv use them automatically. The Problem uv creates the virtual environment inside each project: OneDrive/ └── dev/ └── my-project/ ├── .venv/ ← OneDrive tries to sync this └── pyproject.toml A typical .venv folder contains thousands of small files. OneDrive doesn't know to ignore them and syncs everything, causing slowdowns, conflicts, and sometimes corrupted environments. The Solution Centralize environments outside of OneDrive using the UV_PROJECT_ENVIRONMENT environment variable: C:\Users\username\ ├── OneDrive\dev\my-project\ ← code, synced by OneDrive └── .venvs\my-project\ ← environment, outside OneDrive uv respects UV_PROJECT_ENVIRONMENT and creates the environment wherever you point i