@@ -4,28 +4,30 @@ uv persists data in several locations on your system.
44
55## Directory Strategies
66
7- uv follows platform conventions for determining where to store different types of data.
7+ uv follows platform conventions (like
8+ [ XDG] ( https://specifications.freedesktop.org/basedir-spec/latest/ ) on Unix) for determining where to
9+ store different types of data.
810
911Generally, it's best to configure these rather than each uv-specific storage location.
1012
1113### Cache
1214
13- For temporary files and caches:
15+ Storage location for temporary files and caches:
1416
15- - ` $XDG_CACHE_HOME/uv ` or ` $HOME /.cache/uv` on Unix systems
17+ - ` $XDG_CACHE_HOME/uv ` or ` ~ /.cache/uv` on Unix systems
1618- ` %LOCALAPPDATA%\uv\cache ` on Windows
1719
1820### Data
1921
20- For persistent application data:
22+ Storage location for persistent application data:
2123
2224- ` $XDG_DATA_HOME/uv ` or ` ~/.local/share/uv ` on Unix systems
2325- ` %APPDATA%\uv\data ` on Windows
2426- ` .uv ` in the working directory as a fallback
2527
2628### Config
2729
28- For user configuration files:
30+ Storage location for user configuration files:
2931
3032- ` $XDG_CONFIG_HOME/uv ` or ` ~/.config/uv ` on Unix systems
3133- ` %APPDATA%\uv ` on Windows
@@ -35,26 +37,37 @@ For system configuration files:
3537- ` $XDG_CONFIG_DIRS/uv ` or ` /etc/uv ` on Unix systems
3638- ` %PROGRAMDATA%\uv ` on Windows
3739
38- ### Binaries
40+ ### Executables
3941
40- For executable files:
42+ Unlike other directory schemes above, uv follows the XDG standard on _ all platforms_ by default,
43+ notably including Windows and macOS, as there is no clear alternative location to place executables
44+ on these platforms.
4145
42- - ` $XDG_BIN_HOME ` , ` $XDG_DATA_HOME/../bin ` , or ` ~/.local/bin ` on all platforms
46+ The installation directory is determined by consulting the following environment variables if
47+ they're set:
48+
49+ - ` $XDG_BIN_HOME `
50+ - ` $XDG_DATA_HOME/../bin `
51+ - ` ~/.local/bin `
52+
53+ The above can be overridden by an environment variable specific to [ tools] ( #tool-executables ) or
54+ [ Python executables] ( #python-executables ) .
55+
56+ uv itself is also installed in the above folders by [ the installer] ( ./installer.md ) , and it can be
57+ overridden via the ` UV_INSTALL_DIR ` environment variable.
4358
4459## Cache
4560
46- uv uses a local cache to avoid re-downloading and re-building dependencies. The cache contains
47- wheels, source distributions, responses from package indexes, Git repositories, and Python
48- interpreter metadata.
61+ uv uses a local cache to avoid re-downloading and re-building dependencies.
4962
50- By default, the cache is stored in the [ cache home] ( #cache ) .
63+ By default, the cache is stored in the [ cache home] ( #cache ) , which can be overridden via command
64+ line arguments, environment variables, or settings as detailed in [ the cache
65+ documentation] ( ../concepts/cache.md#cache-directory ) .
5166
5267Use ` uv cache dir ` to show the current cache directory path.
5368
54- Use the ` --cache-dir ` option or set the ` UV_CACHE_DIR ` environment variable to configure the cache
55- location.
56-
57- For more details, see the [ cache documentation] ( ../concepts/cache.md ) .
69+ It is important for performance for the cache directory to be on the same filesystem as the
70+ [ virtualenvs] ( #project-environments ) uv operates on.
5871
5972## Python versions
6073
@@ -77,16 +90,15 @@ For more details, see the [Python versions documentation](../concepts/python-ver
7790
7891uv also supports adding Python executables to your ` PATH ` .
7992
80- By default, Python executables are stored in the [ bin home] ( #bin ) .
93+ By default, Python executables are stored in the [ bin home] ( #executables ) .
8194
8295Use ` uv python dir --bin ` to show the Python executable directory.
8396
8497Use the ` UV_PYTHON_BIN_DIR ` environment variable to configure the executable directory.
8598
8699## Tools
87100
88- uv can install Python applications as tools using ` uv tool install ` . Each tool gets its own isolated
89- environment.
101+ uv can install Python applications as tools using ` uv tool install ` .
90102
91103By default, tools are installed in the [ data home] ( #data ) under a ` tools/ ` subdirectory, e.g.,
92104` ~/.local/share/uv/tools `
@@ -101,15 +113,16 @@ For more details, see the [tools documentation](../concepts/tools.md).
101113
102114When installing tools, uv will add tools to your ` PATH ` .
103115
104- By default, tool executbales are stored in the [ bin home] ( #bin ) .
116+ By default, tool executables are stored in the [ bin home] ( #executables ) .
105117
106118Use ` uv tool dir --bin ` to show the tool executable directory.
107119
108120Use the ` UV_TOOL_BIN_DIR ` environment variable to configure the executable directory.
109121
110122## Configuration
111123
112- uv's behavior can be configured through configuration files stored in standard locations.
124+ uv's behavior (including most of the storage locations on this page) can be configured through
125+ configuration files stored in standard locations.
113126
114127Configuration files are located in the [ config directories] ( #config ) .
115128
0 commit comments