0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

macOSにHomebrewとPythonをインストールする

Last updated at Posted at 2025-09-16

はじめに

macOSでプログラミングを始める際、環境構築につまずく方も多いのではないでしょうか。この記事では、Homebrewというパッケージマネージャーを使って、簡単にPythonをインストールする方法を解説します。

1. Homebrewのインストール

Homebrewは、macOSでソフトウェアを簡単にインストール・管理できる便利なツールです。

まず、ターミナルを開き、以下のコマンドをコピー&ペーストして実行します。

Bash
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

インストール中にパスワードの入力を求められたら、macOSのログインパスワードを入力してください。

2. Pythonのインストール

Homebrewのインストールが完了したら、いよいよPythonをインストールします。

ターミナルで以下のコマンドを実行します。

Bash
brew install python

このコマンドは、最新版のPythonをインストールします。

3. インストールの確認

Pythonが正しくインストールされたか確認しましょう。

以下のコマンドを実行して、バージョン情報が表示されれば成功です。

Bash
python3 --version

※注意点
macOSには元々Pythonがインストールされていますが、システム用のため、HomebrewでインストールしたPythonを使用するのが一般的です。コマンドをpython3とすることで、HomebrewでインストールしたPythonが実行されます。

まとめ

この記事では、以下の手順でmacOSにPythonの開発環境を構築しました。

Homebrewのインストール

brew install pythonでPythonをインストール

python3 --versionでインストール確認

Homebrewを使いこなせば、Macでの開発がぐっと楽になります。ぜひ、あなたの開発ライフに役立ててください!

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?