Qiita Conference 2025

ミノ駆動 (@MinoDriven)

プロフェッショナルとしての成長──「問題の深掘り」が導く真のスキルアップ

50
59

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

pythonのインストール(Mac)

Last updated at Posted at 2018-02-13

Macにはデフォルトでpython2.7が入っています。

$ python --version
python 2.7.10

$ which python
/usr/bin/python

Command Line Toolsのインストール

Command Line Toolsをインストールしておきます。
*バージョンが6.1以降のXcodeをインストールすれば自動でCommand Line Toolsもインストールされます。

$ xcode-select --install

Homebrewでpyenvのインストール

pythonのバージョン管理を行うpyenvをインストールします。

$ brew install pyenv

インストールするバージョンを確認

$ pyenv install --list

インストール

好きなバージョンを指定します。
ここでは3.6.0とします。

$ pyenv install 3.6.0

バージョンの切り替え

使うバージョンを切り替えます。

$ pyenv global 3.6.0

環境変数(パス)の設定

.bash_profileを編集

$ vi ~/.bash_profile

以下を追記します。

export PATH="$HOME/.pyenv/shims:$PATH"

ファイル再読み込み

$ source ~/.bash_profile

確認

$ python --version
Python 3.6.0

$ which python
/Users/oka.haruna/.pyenv/shims/python


☝︎パスとバージョンが変わっていることを確認
50
59
1

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

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
50
59

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?