Skip to content

Storageストレージ

Storage directoriesストレージディレクトリ

uv uses the following high-level directories for storage.uvはストレージのために以下の高レベルディレクトリを使用します。

For each location, uv checks for the existence of environment variables in the given order and uses the first path found.各場所について、uvは指定された順序で環境変数の存在を確認し、最初に見つかったパスを使用します。

The paths of storage directories are platform-specific. uv follows the XDG conventions on Linux and macOS and the Known Folder scheme on Windows.ストレージディレクトリのパスはプラットフォーム固有です。uvはLinuxおよびmacOSでXDGの規約に従い、WindowsではKnown Folderスキームに従います。

Temporary directory一時ディレクトリ

The temporary directory is used for ephemeral data.一時ディレクトリは一時的なデータに使用されます。

  1. $TMPDIR$TMPDIR
  2. /tmp/tmp
  1. %TMP%%TMP%
  2. %TEMP%%TEMP%
  3. %USERPROFILE%%USERPROFILE%

Cache directoryキャッシュディレクトリ

The cache directory is used for data that is disposable, but is useful to be long-lived.キャッシュディレクトリは、一時的なデータに使用されますが、長期間保持することが有用です。

  1. $XDG_CACHE_HOME/uv$XDG_CACHE_HOME/uv
  2. $HOME/.cache/uv$HOME/.cache/uv
  1. %LOCALAPPDATA%\uv\cache%LOCALAPPDATA%\uv\cache
  2. uv\cache within FOLDERID_LocalAppDatauv\cacheFOLDERID_LocalAppData 内にあります。

Persistent data directory永続データディレクトリ

The persistent data directory is used for non-disposable data.永続データディレクトリは、使い捨てでないデータに使用されます。

  1. $XDG_DATA_HOME/uv$XDG_DATA_HOME/uv
  2. $HOME/.local/share/uv$HOME/.local/share/uv
  3. $CWD/.uv$CWD/.uv
  1. %APPDATA%\uv\data%APPDATA%\uv\data
  2. .\.uv.\.uv

Configuration directories設定ディレクトリ

The configuration directories are used to store changes to uv's settings.設定ディレクトリは、uvの設定の変更を保存するために使用されます。

User-level configurationユーザーレベルの設定

  1. $XDG_CONFIG_HOME/uv$XDG_CONFIG_HOME/uv
  2. $HOME/.config/uv$HOME/.config/uv
  1. %APPDATA%\uv%APPDATA%\uv
  2. uv within FOLDERID_RoamingAppDatauvFOLDERID_RoamingAppData 内にあります

System-level configurationシステムレベルの設定

  1. $XDG_CONFIG_DIRS/uv$XDG_CONFIG_DIRS/uv
  2. /etc/uv/etc/uv
  1. %PROGRAMDATA%\uv%PROGRAMDATA%\uv
  2. uv within FOLDERID_AppDataProgramDatauvFOLDERID_AppDataProgramData 内にあります

Executable directory実行可能ディレクトリ

The executable directory is used to store files that can be run by the user, i.e., a directory that should be on the PATH.実行可能ディレクトリは、ユーザーが実行できるファイルを保存するために使用されます。つまり、PATH に含まれるべきディレクトリです。

  1. $XDG_BIN_HOME$XDG_BIN_HOME
  2. $XDG_DATA_HOME/../bin$XDG_DATA_HOME/../bin
  3. $HOME/.local/bin$HOME/.local/bin
  1. %XDG_BIN_HOME%%XDG_BIN_HOME%
  2. %XDG_DATA_HOME%\..\bin%XDG_DATA_HOME%\..\bin
  3. %USERPROFILE%\.local\bin%USERPROFILE%\.local\bin

Types of dataデータの種類

Dependency cache依存関係キャッシュ

uv uses a local cache to avoid re-downloading and re-building dependencies.uvは、依存関係の再ダウンロードと再ビルドを避けるためにローカルキャッシュを使用します。

By default, the cache is stored in the cache directory but it can be overridden via command line arguments, environment variables, or settings as detailed in the cache documentation. When the cache is disabled, the cache will be stored in a temporary directory.デフォルトでは、キャッシュはキャッシュディレクトリに保存されますが、コマンドライン引数、環境変数、またはキャッシュドキュメントに詳述された設定を介して上書きできます。キャッシュが無効になっている場合、キャッシュは一時ディレクトリに保存されます。

Use uv cache dir to show the current cache directory path.uv cache dirを使用して現在のキャッシュディレクトリのパスを表示します。

Important重要

For optimal performance, the cache directory needs to be on the same filesystem as virtual environments.最適なパフォーマンスのために、キャッシュディレクトリは仮想環境と同じファイルシステム上にある必要があります。

Python versionsPythonのバージョン

uv can install managed Python versions, e.g., with uv python install.uvは管理されたPythonバージョンをインストールできます。例えば、uv python installを使用します。

By default, Python versions managed by uv are stored in a python/ subdirectory of the persistent data directory, e.g., ~/.local/share/uv/python.デフォルトでは、uvによって管理されるPythonのバージョンは、python/サブディレクトリに保存されます 永続データディレクトリ内に、例えば~/.local/share/uv/pythonのように。

Use uv python dir to show the Python installation directory.uv python dirを使用して、Pythonのインストールディレクトリを表示します。

Use the UV_PYTHON_INSTALL_DIR environment variable to override the installation directory.UV_PYTHON_INSTALL_DIR環境変数を使用して、インストールディレクトリを上書きします。

Note注意

Changing where Python is installed will not be automatically reflected in existing virtual environments; they will keep referring to the old location, and will need to be updated manually (e.g. by re-creating them).Pythonのインストール場所を変更しても、既存の仮想環境には自動的に反映されません。それらは古い場所を参照し続けるため、手動で更新する必要があります(例えば、再作成することで)。

Python executablesPython実行可能ファイル

uv installs executables for Python versions, e.g., python3.13.uvは、Pythonのバージョンに対して実行可能ファイルをインストールします。例えば、python3.13のように。

By default, Python executables are stored in the executable directory.デフォルトでは、Pythonの実行可能ファイルは実行可能ディレクトリに保存されます。

Use uv python dir --bin to show the Python executable directory.uv python dir --binを使用して、Pythonの実行可能ディレクトリを表示します。

Use the UV_PYTHON_BIN_DIR environment variable to override the Python executable directory.UV_PYTHON_BIN_DIR環境変数を使用して、Pythonの実行可能ディレクトリを上書きします。

Toolsツール

uv can install Python packages as command-line tools using uv tool install.uvは、コマンドラインツールとしてPythonパッケージをインストールできます。 uv tool installを使用して。

By default, tools are installed in a tools/ subdirectory of the persistent data directory, e.g., ~/.local/share/uv/tools.デフォルトでは、ツールは永続データディレクトリtools/サブディレクトリにインストールされます。例えば、~/.local/share/uv/toolsです。

Use uv tool dir to show the tool installation directory.uv tool dirを使用してツールのインストールディレクトリを表示します。

Use the UV_TOOL_DIR environment variable to configure the installation directory.UV_TOOL_DIR環境変数を使用してインストールディレクトリを設定します。

Tool executablesツールの実行可能ファイル

uv installs executables for installed tools, e.g., ruff.uvはインストールされたツールの実行可能ファイルをインストールします。例えば、ruffです。

By default, tool executables are stored in the executable directory.デフォルトでは、ツールの実行可能ファイルは実行可能ディレクトリに保存されます。

Use uv tool dir --bin to show the tool executable directory.uv tool dir --binを使用してツールの実行可能ディレクトリを表示します。

Use the UV_TOOL_BIN_DIR environment variable to configure the tool executable directory.UV_TOOL_BIN_DIR環境変数を使用してツールの実行可能ディレクトリを設定します。

The uv executableuv実行可能ファイル

When using uv's standalone installer to install uv, the uv and uvx executables are installed into the executable directory.uvのスタンドアロンインストーラーを使用してuvをインストールする際、uvおよびuvx実行可能ファイルは実行可能ディレクトリにインストールされます。

Use the UV_INSTALL_DIR environment variable to configure uv's installation directory.UV_INSTALL_DIR環境変数を使用してuvのインストールディレクトリを設定します。

Configuration files設定ファイル

uv's behavior can be configured through TOML files.uvの動作はTOMLファイルを通じて設定できます。

Configuration files are discovered in the configuration directories.設定ファイルは設定ディレクトリで発見されます。

For more details, see the configuration files documentation.詳細については、設定ファイルのドキュメントを参照してください。

Project virtual environmentsプロジェクトの仮想環境

When working on projects, uv creates a dedicated virtual environment for each project.プロジェクトに取り組む際、uvは各プロジェクトのために専用の仮想環境を作成します。

By default, project virtual environments are created in .venv in the project or workspace root, i.e., next to the pyproject.toml.デフォルトでは、プロジェクトの仮想環境はプロジェクトまたはワークスペースのルートにある.venvに作成されます。 すなわち、pyproject.tomlの隣に作成されます。

Use the UV_PROJECT_ENVIRONMENT environment variable to override this location. For more details, see the projects environment documentation.UV_PROJECT_ENVIRONMENT環境変数を使用してこの場所を上書きできます。詳細については、 プロジェクト環境のドキュメントを参照してください。

Script virtual environmentsスクリプトの仮想環境

When running scripts with inline metadata, uv creates a dedicated virtual environment for each script in the cache directory.インラインメタデータを持つスクリプトを実行する際、uvはキャッシュディレクトリ内に各スクリプトのための専用の仮想環境を作成します。