LoginSignup
2
2

More than 5 years have passed since last update.

macにpython3をインストールする手順

Last updated at Posted at 2017-07-12

brewでpyenvをインストール

$ brew install pyenv

PATHを通す。
vim ~/.bash_profile
に以下を追加

export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"

反映
source ~/.bash_profile

echo $PATH
で確認

pythonをインストールする

$ pyenv install 3.6.1

BUILD FAILED (OS X 10.12.5 using python-build 20160602)
hogehoge~~
zipimport.ZipImportError: can't decompress data; zlib not available
make: *** [install] Error 1

上記のようにインストールに失敗した場合はzlibをインストールして再度インストールを行う

$ xcode-select --install

再度インストールすれば完了!

verの切り替え

$ pyenv global 3.6.1

verの確認

$ python --version
2
2
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
2
2