Installing PythonPythonのインストール
If Python is already installed on your system, uv will detect and use it without configuration. However, uv can also install and manage Python versions. uv automatically installs missing Python versions as needed — you don't need to install Python to get started.システムにPythonが既にインストールされている場合、uvは それを検出して使用します。 ただし、uvはPythonのバージョンをインストールおよび管理することもできます。 uvは不足しているPythonバージョンを自動的にインストールします — 開始するためにPythonをインストールする必要はありません。
Getting startedはじめに
To install the latest Python version:最新のPythonバージョンをインストールするには:
Note注意
Python does not publish official distributable binaries. As such, uv uses distributions from the Astral python-build-standalone project. See the Python distributions documentation for more details.Pythonは公式の配布可能なバイナリを公開していません。そのため、uvはAstralのpython-build-standaloneプロジェクトからのディストリビューションを使用します。 詳細については、Pythonディストリビューションのドキュメントを参照してください。
Once Python is installed, it will be used by uv commands automatically. uv also adds the installed
version to your PATH:Pythonがインストールされると、uvコマンドによって自動的に使用されます。 uvはまた、インストールされたバージョンをPATHに追加します:
uv only installs a versioned executable by default. To install python and python3 executables,
include the experimental --default option:uvはデフォルトでバージョン付きの実行可能ファイルのみをインストールします。 pythonおよびpython3の実行可能ファイルをインストールするには、実験的な--defaultオプションを含めてください:
Tipヒント
See the documentation on installing Python executables for more details.Python実行可能ファイルのインストールに関するドキュメントを参照して、詳細を確認してください。
Installing a specific version特定のバージョンのインストール
To install a specific Python version:特定のPythonバージョンをインストールするには:
To install multiple Python versions:複数のPythonバージョンをインストールするには:
To install an alternative Python implementation, e.g., PyPy:代替のPython実装をインストールするには、例えば、PyPyを使用します:
See the python install documentation
for more details.python install ドキュメントを参照してください
詳細については。
Reinstalling PythonPythonの再インストール
To reinstall uv-managed Python versions, use --reinstall, e.g.:uv管理のPythonバージョンを再インストールするには、--reinstallを使用します。例えば:
This will reinstall all previously installed Python versions. Improvements are constantly being added to the Python distributions, so reinstalling may resolve bugs even if the Python version does not change.これにより、以前にインストールされたすべてのPythonバージョンが再インストールされます。Pythonディストリビューションには常に改善が加えられているため、Pythonのバージョンが変更されなくても再インストールすることでバグが解決される場合があります。
Viewing Python installationsPythonインストールの表示
To view available and installed Python versions:利用可能なPythonバージョンとインストールされたPythonバージョンを表示するには:
See the python list
documentation for more details.python list
ドキュメントを参照してください。詳細については。
Automatic Python downloads自動Pythonダウンロード
Python does not need to be explicitly installed to use uv. By default, uv will automatically download Python versions when they are required. For example, the following would download Python 3.12 if it was not installed:uvを使用するためにPythonを明示的にインストールする必要はありません。デフォルトでは、uvは必要なときにPythonバージョンを自動的にダウンロードします。例えば、次のコマンドは、Python 3.12がインストールされていない場合にそれをダウンロードします:
Even if a specific Python version is not requested, uv will download the latest version on demand. For example, if there are no Python versions on your system, the following will install Python before creating a new virtual environment:特定のPythonバージョンが要求されていなくても、uvは必要に応じて最新のバージョンをダウンロードします。 例えば、システムにPythonのバージョンがない場合、以下のコマンドは新しい仮想環境を作成する前にPythonをインストールします:
Tipヒント
Automatic Python downloads can be easily disabled if you want more control over when Python is downloaded.自動Pythonダウンロードは、簡単に無効化できるので、Pythonがダウンロードされるタイミングをよりコントロールしたい場合に便利です。
Using existing Python versions既存のPythonバージョンを使用する
uv will use existing Python installations if present on your system. There is no configuration necessary for this behavior: uv will use the system Python if it satisfies the requirements of the command invocation. See the Python discovery documentation for details.uvは、システムに既存のPythonインストールがある場合、それを使用します。この動作には設定は必要ありません:uvは、コマンドの呼び出しの要件を満たす場合、システムPythonを使用します。詳細については、 Pythonの発見に関するドキュメントを参照してください。
To force uv to use the system Python, provide the --no-managed-python flag. See the
Python version preference
documentation for more details.uvにシステムPythonを強制的に使用させるには、--no-managed-pythonフラグを指定します。詳細については、
Pythonバージョンの優先順位に関するドキュメントを参照してください。
Upgrading Python versionsPythonバージョンのアップグレード
Important重要
Support for upgrading Python patch versions is in preview. This means the behavior is experimental and subject to change.Pythonのパッチバージョンのアップグレードサポートはプレビュー中です。これは、動作が実験的であり、変更される可能性があることを意味します。
To upgrade a Python version to the latest supported patch release:Pythonのバージョンを最新のサポートされているパッチリリースにアップグレードするには:
To upgrade all uv-managed Python versions:すべてのuv管理のPythonバージョンをアップグレードするには:
See the python upgrade documentation
for more details.python upgradeに関するドキュメントを参照して、詳細を確認してください。
Next steps次のステップ
To learn more about uv python, see the Python version concept
page and the command reference.uv pythonについて詳しく知りたい場合は、Pythonバージョンの概念ページと、コマンドリファレンスを参照してください。
Or, read on to learn how to run scripts and invoke Python with uv.または、スクリプトを実行する方法や、uvでPythonを呼び出す方法について学ぶために読み進めてください。