Mac python3環境の作り方メモ

ぜんぶ、Macのターミナルで行う
① python3系のインストールまで

・まずhomebrewをインストー

 ターミナルにて下記ページのスクリプトを実行

 Homebrew — The missing package manager for macOS
https://brew.sh

・pyenvインストー

brew install pyenv

pythonのインストール(pyenv install --listでインストールバージョン確認 )

pyenv install 3.6.2

・.bash_profileの作成(なければ)

cd ~
touch .bash_profile

・pathを通す

vi ~/.bash_profile

.bash_profileに
「export PATH="$HOME/.pyenv/shims:$PATH"」
を書き込み

・python3に切り替え

pyenv global 3.6.2
peen rehash

② pipのインストー

easy_install pip

③ jupyter notebookの起動まで
・jupyterのインストー

pip install jupyter 

・サファリで開くための準備

jupyter notebook --generate-config #jupyter_notebook_config.py作成
vi ~/.jupyter/jupyter_notebook_config.py

で、jupyter_notebook_config.py内に
「c.NotebookApp.browser = u'Safari'」を入力

④ Jupyter notebook起動

jupyter notebook

f:id:gramp:20170726004511p:plain