jupyter notebookをインストールする

 

marimeimikan@marimeimikan:~$ python3 --versionPython 3.6.5

http://mikanroom.hatenablog.com/entry/%E2%96%A0

 

pythonのバージョンを確認

marimeimikan@marimeimikan:~$ python3 --version
Python 3.6.5 

②pipのインストール

marimeimikan@marimeimikan:~$ pip3

Command 'pip3' not found, but can be installed with:

sudo apt install python3-pip

 marimeimikan@marimeimikan:~$ sudo apt install python3-pip
[sudo] marimeimikan のパスワード: 

 ③パッケージのインストール

  • numpy

marimeimikan@marimeimikan:~$ pip3 install numpy
Collecting numpy
Downloading https://files.pythonhosted.org/packages/7b/74/54c5f9bb9bd4dae27a61ec1b39076a39d359b3fb7ba15da79ef23858a9d8/numpy-1.16.0-cp36-cp36m-manylinux1_x86_64.whl (17.3MB)
100% |████████████████████████████████| 17.3MB 89kB/s
Installing collected packages: numpy
Successfully installed numpy-1.16.0

  • scipy

marimeimikan@marimeimikan:~$ pip3 install scipy
Collecting scipy
Downloading https://files.pythonhosted.org/packages/67/e6/6d4edaceee6a110ecf6f318482f5229792f143e468b34a631f5a0899f56d/scipy-1.2.0-cp36-cp36m-manylinux1_x86_64.whl (26.6MB)
100% |████████████████████████████████| 26.6MB 58kB/s
Collecting numpy>=1.8.2 (from scipy)
Using cached https://files.pythonhosted.org/packages/7b/74/54c5f9bb9bd4dae27a61ec1b39076a39d359b3fb7ba15da79ef23858a9d8/numpy-1.16.0-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: numpy, scipy
Successfully installed numpy-1.16.0 scipy-1.2.0

  •  matplotlib

marimeimikan@marimeimikan:~$ pip3 install matplotlib
Collecting matplotlib

   :

Installing collected packages: pyparsing, six, python-dateutil, setuptools, kiwisolver, numpy, cycler, matplotlib
Successfully installed cycler-0.10.0 kiwisolver-1.0.1 matplotlib-3.0.2 numpy-1.16.0 pyparsing-2.3.1 python-dateutil-2.7.5 setuptools-40.6.3 six-1.12.0

  •  ipython

marimeimikan@marimeimikan:~$ pip3 install ipython
Collecting ipython

   :

Installing collected packages: parso, jedi, setuptools, decorator, backcall, wcwidth, six, prompt-toolkit, ptyprocess, pexpect, ipython-genutils, traitlets, pickleshare, pygments, ipython
Successfully installed backcall-0.1.0 decorator-4.3.0 ipython-7.2.0 ipython-genutils-0.2.0 jedi-0.13.2 parso-0.3.1 pexpect-4.6.0 pickleshare-0.7.5 prompt-toolkit-2.0.7 ptyprocess-0.6.0 pygments-2.3.1 setuptools-40.6.3 six-1.12.0 traitlets-4.3.2 wcwidth-0.1.7

  • scikit-learn

marimeimikan@marimeimikan:~$ pip3 install scikit-learn
Collecting scikit-learn

Downloading https://files.pythonhosted.org/packages/0d/3a/b92670f5c368c20329ecc4c255993fae7934564d485c3ed7ea7b8da7f741/scikit_learn-0.20.2-cp36-cp36m-manylinux1_x86_64.whl (5.4MB)
100% |████████████████████████████████| 5.4MB 272kB/s
Collecting numpy>=1.8.2 (from scikit-learn)
Using cached https://files.pythonhosted.org/packages/7b/74/54c5f9bb9bd4dae27a61ec1b39076a39d359b3fb7ba15da79ef23858a9d8/numpy-1.16.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting scipy>=0.13.3 (from scikit-learn)
Using cached https://files.pythonhosted.org/packages/67/e6/6d4edaceee6a110ecf6f318482f5229792f143e468b34a631f5a0899f56d/scipy-1.2.0-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: numpy, scipy, scikit-learn
Successfully installed numpy-1.16.0 scikit-learn-0.20.2 scipy-1.2.0

  • pandas

marimeimikan@marimeimikan:~$ pip3 install pandas
Collecting pandas
Downloading https://files.pythonhosted.org/packages/e1/d8/feeb346d41f181e83fba45224ab14a8d8af019b48af742e047f3845d8cff/pandas-0.23.4-cp36-cp36m-manylinux1_x86_64.whl (8.9MB)
100% |████████████████████████████████| 8.9MB 163kB/s
Collecting pytz>=2011k (from pandas)
Downloading https://files.pythonhosted.org/packages/61/28/1d3920e4d1d50b19bc5d24398a7cd85cc7b9a75a490570d5a30c57622d34/pytz-2018.9-py2.py3-none-any.whl (510kB)
100% |████████████████████████████████| 512kB 1.5MB/s
Collecting python-dateutil>=2.5.0 (from pandas)
Using cached https://files.pythonhosted.org/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl
Collecting numpy>=1.9.0 (from pandas)
Using cached https://files.pythonhosted.org/packages/7b/74/54c5f9bb9bd4dae27a61ec1b39076a39d359b3fb7ba15da79ef23858a9d8/numpy-1.16.0-cp36-cp36m-manylinux1_x86_64.whl
Collecting six>=1.5 (from python-dateutil>=2.5.0->pandas)
Using cached https://files.pythonhosted.org/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Installing collected packages: pytz, six, python-dateutil, numpy, pandas
Successfully installed numpy-1.16.0 pandas-0.23.4 python-dateutil-2.7.5 pytz-2018.9 six-1.12.0

  • pillow

marimeimikan@marimeimikan:~$ pip3 install pillow
Collecting pillow
Downloading https://files.pythonhosted.org/packages/85/5e/e91792f198bbc5a0d7d3055ad552bc4062942d27eaf75c3e2783cf64eae5/Pillow-5.4.1-cp36-cp36m-manylinux1_x86_64.whl (2.0MB)
100% |████████████████████████████████| 2.0MB 627kB/s
Installing collected packages: pillow
Successfully installed pillow-5.4.1

  •  mglearn

marimeimikan@marimeimikan:~$ pip3 install mglearn
Collecting mglearn

   :

Successfully built mglearn imageio
Installing collected packages: numpy, pyparsing, setuptools, kiwisolver, six, cycler, python-dateutil, matplotlib, scipy, scikit-learn, pytz, pandas, pillow, imageio, mglearn
Successfully installed cycler-0.10.0 imageio-2.4.1 kiwisolver-1.0.1 matplotlib-3.0.2 mglearn-0.1.7 numpy-1.16.0 pandas-0.23.4 pillow-5.4.1 pyparsing-2.3.1 python-dateutil-2.7.5 pytz-2018.9 scikit-learn-0.20.2 scipy-1.2.0 setuptools-40.6.3 six-1.12.0

  • jupyter

marimeimikan@marimeimikan:~$ pip3 install jupyter
Collecting jupyter

   :

Successfully built pandocfilters prometheus-client tornado
Installing collected packages: six, decorator, ipython-genutils, traitlets, jupyter-core, defusedxml, testpath, MarkupSafe, jinja2, pygments, entrypoints, jsonschema, nbformat, mistune, pandocfilters, webencodings, bleach, nbconvert, pyzmq, python-dateutil, tornado, jupyter-client, wcwidth, prompt-toolkit, ptyprocess, pexpect, pickleshare, backcall, parso, jedi, setuptools, ipython, ipykernel, qtconsole, prometheus-client, terminado, Send2Trash, notebook, widgetsnbextension, ipywidgets, jupyter-console, jupyter
Successfully installed MarkupSafe-1.1.0 Send2Trash-1.5.0 backcall-0.1.0 bleach-3.1.0 decorator-4.3.0 defusedxml-0.5.0 entrypoints-0.3 ipykernel-5.1.0 ipython-7.2.0 ipython-genutils-0.2.0 ipywidgets-7.4.2 jedi-0.13.2 jinja2-2.10 jsonschema-2.6.0 jupyter-1.0.0 jupyter-client-5.2.4 jupyter-console-6.0.0 jupyter-core-4.4.0 mistune-0.8.4 nbconvert-5.4.0 nbformat-4.4.0 notebook-5.7.4 pandocfilters-1.4.2 parso-0.3.1 pexpect-4.6.0 pickleshare-0.7.5 prometheus-client-0.5.0 prompt-toolkit-2.0.7 ptyprocess-0.6.0 pygments-2.3.1 python-dateutil-2.7.5 pyzmq-17.1.2 qtconsole-4.4.3 setuptools-40.6.3 six-1.12.0 terminado-0.8.1 testpath-0.4.2 tornado-5.1.1 traitlets-4.3.2 wcwidth-0.1.7 webencodings-0.5.1 widgetsnbextension-3.4.2

④jupyter notebookを起動(再起動後)

marimeimikan@marimeimikan:~$ jupyter notebook
[I 22:07:29.999 NotebookApp] Writing notebook server cookie secret to /run/user/1000/jupyter/notebook_cookie_secret
[I 22:07:30.560 NotebookApp] Serving notebooks from local directory: /home/marimeimikan
[I 22:07:30.561 NotebookApp] The Jupyter Notebook is running at:
[I 22:07:30.561 NotebookApp] http://localhost:8888/?token=48c91c235b78bea036b7d8dc4923fba17fcbcbf81b63a22e
[I 22:07:30.561 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 22:07:30.568 NotebookApp]

To access the notebook, open this file in a browser:
file:///run/user/1000/jupyter/nbserver-1533-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=48c91c235b78bea036b7d8dc4923fba17fcbcbf81b63a22e

f:id:marimeimikan:20190119221039p:plain