![見出し画像](https://assets.st-note.com/production/uploads/images/69736639/rectangle_large_type_2_6c147874082a77b052fd3fe5c4ffc96c.png?width=1200)
[備忘録]Python3,Jupyter Notebookのインストールと起動
[前提条件]
・既にPython3や各モジュールがインストール済みの環境だったのでAnacondaを入れたくない
・JupyterNotebookだけ、サックっとインストールしたい
[基礎知識]
・$ python3 -m [コマンド]:pythonのモジュールを実行する
・$ python3 -m pip install jupyter:Jupyter Notebookをインストールする
・$ jupyter notebook:Jupyter Notebookを起動する(ブラウザが起動する)
[実行結果]
$
$ python3 -m pip install jupyter
Collecting jupyter
Downloading jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting ipywidgets
Downloading ipywidgets-7.6.5-py2.py3-none-any.whl (121 kB)
|████████████████████████████████| 121 kB 6.0 MB/s
Collecting notebook
Downloading notebook-6.4.6-py3-none-any.whl (9.9 MB)
|████████████████████████████████| 9.9 MB 14.7 MB/s
Collecting qtconsole
Downloading qtconsole-5.2.2-py3-none-any.whl (120 kB)
|████████████████████████████████| 120 kB 13.0 MB/s
Collecting ipykernel
Downloading ipykernel-5.5.6-py3-none-any.whl (121 kB)
|████████████████████████████████| 121 kB 11.7 MB/s
Collecting jupyter-console
Downloading jupyter_console-6.4.0-py3-none-any.whl (22 kB)
Collecting nbconvert
Downloading nbconvert-6.0.7-py3-none-any.whl (552 kB)
|████████████████████████████████| 552 kB 13.2 MB/s
Collecting appnope
Downloading appnope-0.1.2-py2.py3-none-any.whl (4.3 kB)
Collecting jupyter-client
Downloading jupyter_client-7.1.0-py3-none-any.whl (129 kB)
|████████████████████████████████| 129 kB 13.4 MB/s
Collecting tornado>=4.2
Downloading tornado-6.1-cp36-cp36m-macosx_10_9_x86_64.whl (416 kB)
|████████████████████████████████| 416 kB 13.7 MB/s
Collecting ipython>=5.0.0
Downloading ipython-7.16.2-py3-none-any.whl (782 kB)
|████████████████████████████████| 782 kB 12.4 MB/s
Collecting traitlets>=4.1.0
Downloading traitlets-4.3.3-py2.py3-none-any.whl (75 kB)
|████████████████████████████████| 75 kB 7.7 MB/s
Collecting ipython-genutils
Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB)
Collecting nbformat>=4.2.0
Downloading nbformat-5.1.3-py3-none-any.whl (178 kB)
|████████████████████████████████| 178 kB 11.5 MB/s
Collecting jupyterlab-widgets>=1.0.0
Downloading jupyterlab_widgets-1.0.2-py3-none-any.whl (243 kB)
|████████████████████████████████| 243 kB 11.7 MB/s
Collecting widgetsnbextension~=3.5.0
Downloading widgetsnbextension-3.5.2-py2.py3-none-any.whl (1.6 MB)
|████████████████████████████████| 1.6 MB 14.3 MB/s
Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0
Downloading prompt_toolkit-3.0.24-py3-none-any.whl (374 kB)
|████████████████████████████████| 374 kB 11.0 MB/s
Collecting pygments
Downloading Pygments-2.11.2-py3-none-any.whl (1.1 MB)
|████████████████████████████████| 1.1 MB 13.6 MB/s
Collecting entrypoints>=0.2.2
Downloading entrypoints-0.3-py2.py3-none-any.whl (11 kB)
Collecting jupyterlab-pygments
Downloading jupyterlab_pygments-0.1.2-py2.py3-none-any.whl (4.6 kB)
Collecting bleach
Downloading bleach-4.1.0-py2.py3-none-any.whl (157 kB)
|████████████████████████████████| 157 kB 11.0 MB/s
Collecting defusedxml
Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting testpath
Downloading testpath-0.5.0-py3-none-any.whl (84 kB)
|████████████████████████████████| 84 kB 6.0 MB/s
Collecting nbclient<0.6.0,>=0.5.0
Downloading nbclient-0.5.9-py3-none-any.whl (69 kB)
|████████████████████████████████| 69 kB 9.8 MB/s
Collecting jupyter-core
Downloading jupyter_core-4.9.1-py3-none-any.whl (86 kB)
|████████████████████████████████| 86 kB 7.5 MB/s
Collecting pandocfilters>=1.4.1
Downloading pandocfilters-1.5.0-py2.py3-none-any.whl (8.7 kB)
Collecting mistune<2,>=0.8.1
Downloading mistune-0.8.4-py2.py3-none-any.whl (16 kB)
Requirement already satisfied: jinja2>=2.4 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from nbconvert->jupyter) (2.11.2)
Collecting terminado>=0.8.3
Downloading terminado-0.12.1-py3-none-any.whl (15 kB)
Collecting Send2Trash>=1.8.0
Downloading Send2Trash-1.8.0-py3-none-any.whl (18 kB)
Collecting prometheus-client
Downloading prometheus_client-0.12.0-py2.py3-none-any.whl (57 kB)
|████████████████████████████████| 57 kB 8.3 MB/s
Collecting argon2-cffi
Downloading argon2_cffi-21.3.0-py3-none-any.whl (14 kB)
Collecting pyzmq>=17
Downloading pyzmq-22.3.0-cp36-cp36m-macosx_10_9_x86_64.whl (1.3 MB)
|████████████████████████████████| 1.3 MB 11.1 MB/s
Collecting nest-asyncio>=1.5
Downloading nest_asyncio-1.5.4-py3-none-any.whl (5.1 kB)
Collecting qtpy
Downloading QtPy-2.0.0-py3-none-any.whl (62 kB)
|████████████████████████████████| 62 kB 1.4 MB/s
Collecting jedi<=0.17.2,>=0.10
Downloading jedi-0.17.2-py2.py3-none-any.whl (1.4 MB)
|████████████████████████████████| 1.4 MB 10.0 MB/s
Collecting pexpect
Downloading pexpect-4.8.0-py2.py3-none-any.whl (59 kB)
|████████████████████████████████| 59 kB 9.5 MB/s
Collecting decorator
Downloading decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting backcall
Downloading backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: setuptools>=18.5 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from ipython>=5.0.0->ipykernel->jupyter) (40.6.2)
Collecting pickleshare
Downloading pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Requirement already satisfied: MarkupSafe>=0.23 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from jinja2>=2.4->nbconvert->jupyter) (1.1.1)
Requirement already satisfied: python-dateutil>=2.1 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from jupyter-client->ipykernel->jupyter) (2.8.1)
Collecting async-generator
Downloading async_generator-1.10-py3-none-any.whl (18 kB)
Collecting jsonschema!=2.5.0,>=2.4
Downloading jsonschema-3.2.0-py2.py3-none-any.whl (56 kB)
|████████████████████████████████| 56 kB 6.7 MB/s
Collecting wcwidth
Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting ptyprocess
Downloading ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB)
Requirement already satisfied: six in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from traitlets>=4.1.0->ipykernel->jupyter) (1.15.0)
Collecting dataclasses
Downloading dataclasses-0.8-py3-none-any.whl (19 kB)
Collecting argon2-cffi-bindings
Downloading argon2_cffi_bindings-21.2.0-cp36-abi3-macosx_10_9_x86_64.whl (29 kB)
Collecting typing-extensions
Downloading typing_extensions-4.0.1-py3-none-any.whl (22 kB)
Collecting webencodings
Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting packaging
Downloading packaging-21.3-py3-none-any.whl (40 kB)
|████████████████████████████████| 40 kB 8.9 MB/s
Collecting parso<0.8.0,>=0.7.0
Downloading parso-0.7.1-py2.py3-none-any.whl (109 kB)
|████████████████████████████████| 109 kB 10.1 MB/s
Collecting attrs>=17.4.0
Downloading attrs-21.4.0-py2.py3-none-any.whl (60 kB)
|████████████████████████████████| 60 kB 7.5 MB/s
Collecting importlib-metadata
Downloading importlib_metadata-4.8.3-py3-none-any.whl (17 kB)
Collecting pyrsistent>=0.14.0
Downloading pyrsistent-0.18.0-cp36-cp36m-macosx_10_9_x86_64.whl (68 kB)
|████████████████████████████████| 68 kB 8.7 MB/s
Collecting cffi>=1.0.1
Downloading cffi-1.15.0-cp36-cp36m-macosx_10_9_x86_64.whl (178 kB)
|████████████████████████████████| 178 kB 14.1 MB/s
Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages (from packaging->bleach->nbconvert->jupyter) (2.4.7)
Collecting pycparser
Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
|████████████████████████████████| 118 kB 14.2 MB/s
Collecting zipp>=0.5
Downloading zipp-3.6.0-py3-none-any.whl (5.3 kB)
Installing collected packages: zipp, typing-extensions, ipython-genutils, decorator, traitlets, pyrsistent, importlib-metadata, attrs, wcwidth, tornado, pyzmq, pycparser, ptyprocess, parso, nest-asyncio, jupyter-core, jsonschema, entrypoints, webencodings, pygments, prompt-toolkit, pickleshare, pexpect, packaging, nbformat, jupyter-client, jedi, cffi, backcall, async-generator, appnope, testpath, pandocfilters, nbclient, mistune, jupyterlab-pygments, ipython, defusedxml, dataclasses, bleach, argon2-cffi-bindings, terminado, Send2Trash, prometheus-client, nbconvert, ipykernel, argon2-cffi, notebook, widgetsnbextension, qtpy, jupyterlab-widgets, qtconsole, jupyter-console, ipywidgets, jupyter
Successfully installed Send2Trash-1.8.0 appnope-0.1.2 argon2-cffi-21.3.0 argon2-cffi-bindings-21.2.0 async-generator-1.10 attrs-21.4.0 backcall-0.2.0 bleach-4.1.0 cffi-1.15.0 dataclasses-0.8 decorator-5.1.1 defusedxml-0.7.1 entrypoints-0.3 importlib-metadata-4.8.3 ipykernel-5.5.6 ipython-7.16.2 ipython-genutils-0.2.0 ipywidgets-7.6.5 jedi-0.17.2 jsonschema-3.2.0 jupyter-1.0.0 jupyter-client-7.1.0 jupyter-console-6.4.0 jupyter-core-4.9.1 jupyterlab-pygments-0.1.2 jupyterlab-widgets-1.0.2 mistune-0.8.4 nbclient-0.5.9 nbconvert-6.0.7 nbformat-5.1.3 nest-asyncio-1.5.4 notebook-6.4.6 packaging-21.3 pandocfilters-1.5.0 parso-0.7.1 pexpect-4.8.0 pickleshare-0.7.5 prometheus-client-0.12.0 prompt-toolkit-3.0.24 ptyprocess-0.7.0 pycparser-2.21 pygments-2.11.2 pyrsistent-0.18.0 pyzmq-22.3.0 qtconsole-5.2.2 qtpy-2.0.0 terminado-0.12.1 testpath-0.5.0 tornado-6.1 traitlets-4.3.3 typing-extensions-4.0.1 wcwidth-0.2.5 webencodings-0.5.1 widgetsnbextension-3.5.2 zipp-3.6.0
$
$
$
$ jupyter notebook
[I 11:20:29.998 NotebookApp] ノートブックサーバは cookie secret を /Users/hoge/Library/Jupyter/runtime/notebook_cookie_secret に書き込みます
[I 11:20:30.416 NotebookApp] ローカルディレクトリからノートブックをサーブ: /Users/hoge
[I 11:20:30.417 NotebookApp] Jupyter Notebook 6.4.6 is running at:
[I 11:20:30.417 NotebookApp] http://localhost:8888/?token=cd9e69ddbaf39d4aa4e0a40978275276348d26c162d9de55
[I 11:20:30.417 NotebookApp] or http://127.0.0.1:8888/?token=cd9e69ddbaf39d4aa4e0a40978275276348d26c162d9de55
[I 11:20:30.417 NotebookApp] サーバを停止し全てのカーネルをシャットダウンするには Control-C を使って下さい(確認をスキップするには2回)。
[C 11:20:30.425 NotebookApp]
To access the notebook, open this file in a browser:
file:///Users/hoge/Library/Jupyter/runtime/nbserver-4300-open.html
Or copy and paste one of these URLs:
http://localhost:8888/?token=cd9e69ddbaf39d4aa4e0a40978275276348d26c162d9de55
or http://127.0.0.1:8888/?token=cd9e69ddbaf39d4aa4e0a40978275276348d26c162d9de55
ブラウザが起動して、以下の画面が表示される。
![](https://assets.st-note.com/img/1641952863665-V24pD4rVUm.png?width=1200)
この記事が気に入ったらサポートをしてみませんか?