Summary
Mac: OS X El Capitan (Ver 10.11.6)
pyenv: 1.0.2
Anaconda: 3-4.1.1
Jupyter: 4.1.0
Install pyenv
Simple Python Version Management: pyenv
Something like rbenv for Python, so that we could easily switch between multiple versions of Python.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
$ brew --verson Homebrew 1.1.0 Homebrew/homebrew-core (git revision 3144; last commit 2016-11-12) $ brew update && brew upgrade $ brew --version Homebrew 1.1.6 Homebrew/homebrew-core (git revision 6c9d; last commit 2017-01-07) $ brew install pyenv $ echo 'export PYENV_ROOT="${HOME}/.pyenv"' >> ~/.zshrc $ echo 'export PATH="${PYENV_ROOT}/bin:$PATH"' >> ~/.zshrc $ echo 'eval "$(pyenv init -)"' >> ~/.zshrc $ source ~/.zshrc $ pyenv --version pyenv 1.0.2 |
Install Anaconda (Python) with Jupyter
Anaconda includes
- Python
- popular packages such as Numpy, SciPy, Jupyter (package list)
- dependency and environment manager (conda)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
$ pyenv install -l | grep anaconda3 anaconda3-2.0.0 anaconda3-2.0.1 anaconda3-2.1.0 anaconda3-2.2.0 anaconda3-2.3.0 anaconda3-2.4.0 anaconda3-2.4.1 anaconda3-2.5.0 anaconda3-4.0.0 anaconda3-4.1.0 anaconda3-4.1.1 $ pyenv install anaconda3-4.1.1 $ pyenv rehash $ pyenv global anaconda3-4.1.1 $ pyenv versions system * anaconda3-4.1.1 (set by /Users/hideharu.hatayama/.pyenv/version) $ python --version Python 3.5.2 :: Anaconda 4.1.1 (x86_64) $ jupyter --version 4.1.0 |
Kick the Notebook
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
$ mkdir -vp /usr/local/hidepiy/notebook mkdir: created directory ‘/usr/local/hidepiy/notebook’ $ jupyter notebook --generate-config $ vi ${HOME}/.jupyter/jupyter_notebook_config.py $ cat ${HOME}/.jupyter/jupyter_notebook_config.py # The port the notebook server will listen on. c.NotebookApp.port = 6109 # The directory to use for notebooks and kernels. c.NotebookApp.notebook_dir = '/usr/local/hidepiy/notebook' $ jupyter notebook [W 02:19:33.025 NotebookApp] Unrecognized JSON config file version, assuming version 1 [I 02:19:33.807 NotebookApp] [nb_conda_kernels] enabled, 1 kernels found [I 02:19:34.577 NotebookApp] [nb_anacondacloud] enabled [I 02:19:34.596 NotebookApp] [nb_conda] enabled [I 02:19:34.761 NotebookApp] ✓ nbpresent HTML export ENABLED [W 02:19:34.762 NotebookApp] ✗ nbpresent PDF export DISABLED: No module named 'nbbrowserpdf' [I 02:19:34.773 NotebookApp] Serving notebooks from local directory: /usr/local/hidepiy/notebook [I 02:19:34.773 NotebookApp] 0 active kernels [I 02:19:34.773 NotebookApp] The Jupyter Notebook is running at: http://localhost:6109/ [I 02:19:34.774 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation). |
This will open the default browser to http://localhost:6109/tree .