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