咸鱼

咸鱼是以盐腌渍后,晒干的鱼

0%

JupyterNotebook安装

Jupyter 是一个编程语言的交互式计算的web服务,简单来说:jupyter作为一个web服务,可以在线在浏览器编程。

jupyter 主要有两个产品:

  • jupyter notebook 在线文档应用,可以在笔记文档里运行python代码,并显示结果。
  • jupyter labnotebook 的加强升级版,用于笔记、代码和数据的最新的基于web的交互式开发环境。

对于学习者,比如我在学Python,我要做笔记:

  • 一般情况:我在编辑器或IDE写代码,运行代码,把代码和运行结果拷贝到笔记。
  • 使用jupyter:在浏览器里写笔记和代码,而笔记里面的代码是可以直接运行的,直观的很。

如何安装?

很简单,直接通过pip就可以安装。

1
2
3
4
5
6
7
8
9
10
11
# 安装 JupyterLab 
$ pip install jupyterlab
# 启动
$ jupyter-lab

# 安装 经典 Jupyter Notebook
$ pip install jupyter # 下面的日志是安装了这个
# 或者
$ pip install notebook # 官网推荐是安装这个
# 启动(会自动打开浏览器,默认端口: 8888)
$ jupyter notebook

注意:jupyterlab 和 jupyter notebook 仅需要安装其中一个。

后续补充

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# 在一台新的机器执行安装,发现配置文件变了
# 而且也安装上了 jupyterlab,扩展安装不上(可能版本更替,不支持,或者自带)
# Web界面也有变化
$ pip install notebook --index-url https://pypi.mirrors.ustc.edu.cn/simple/
# 可能源比较新,安装了notebook+jupyterlab,而且启动日志和配置文件都不一样了
$ jupyter --version
Selected Jupyter core packages...
IPython : 8.14.0
ipykernel : 6.25.0
ipywidgets : not installed
jupyter_client : 8.3.0
jupyter_core : 5.3.1
jupyter_server : 2.7.0
jupyterlab : 4.0.3
nbclient : 0.8.0
nbconvert : 7.7.3
nbformat : 5.9.2
notebook : 7.0.1
qtconsole : not installed
traitlets : 5.9.0

# 当前只要启动jupyter就可以使用notebook和lab
# http://localhost:80 默认是 notebook 主页
# http://localhost:80/lab 是 jupyterlab 主页

# 启动
$ jupyter notebook
[546 ServerApp] ServerApp.password config is deprecated in 2.0. Use PasswordIdentityProvider.hashed_password.
[552 ServerApp] Package notebook took 0.0000s to import
[560 ServerApp] Package jupyter_lsp took 0.0076s to import
[560 ServerApp] A `_jupyter_server_extension_points` function was not found in jupyter_lsp. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[564 ServerApp] Package jupyter_server_terminals took 0.0032s to import
[564 ServerApp] Package jupyterlab took 0.0000s to import
[586 ServerApp] Package notebook_shim took 0.0000s to import
[586 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[586 ServerApp] jupyter_lsp | extension was successfully linked.
[590 ServerApp] jupyter_server_terminals | extension was successfully linked.
[593 ServerApp] jupyterlab | extension was successfully linked.
[597 ServerApp] notebook | extension was successfully linked.
[755 ServerApp] notebook_shim | extension was successfully linked.
[767 ServerApp] WARNING: The Jupyter server is listening on all IP addresses and not using encryption. This is not recommended.
[768 ServerApp] notebook_shim | extension was successfully loaded.
[769 ServerApp] jupyter_lsp | extension was successfully loaded.
[770 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[771 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.10/dist-packages/jupyterlab
[771 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[772 LabApp] Extension Manager is 'pypi'.
[774 ServerApp] jupyterlab | extension was successfully loaded.
[776 ServerApp] notebook | extension was successfully loaded.
[776 ServerApp] Serving notebooks from local directory: /usr/local/notebooks
[776 ServerApp] Jupyter Server 2.7.0 is running at:
[776 ServerApp] http://localhost:80/tree
[776 ServerApp] http://127.0.0.1:80/tree
[776 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).

# 启动
$ jupyter lab
[290 ServerApp] ServerApp.password config is deprecated in 2.0. Use PasswordIdentityProvider.hashed_password.
[296 ServerApp] Package jupyterlab took 0.0000s to import
[303 ServerApp] Package jupyter_lsp took 0.0072s to import
[303 ServerApp] A `_jupyter_server_extension_points` function was not found in jupyter_lsp. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[307 ServerApp] Package jupyter_server_terminals took 0.0031s to import
[307 ServerApp] Package notebook took 0.0000s to import
[308 ServerApp] Package notebook_shim took 0.0000s to import
[308 ServerApp] A `_jupyter_server_extension_points` function was not found in notebook_shim. Instead, a `_jupyter_server_extension_paths` function was found and will be used for now. This function name will be deprecated in future releases of Jupyter Server.
[309 ServerApp] jupyter_lsp | extension was successfully linked.
[312 ServerApp] jupyter_server_terminals | extension was successfully linked.
[315 ServerApp] jupyterlab | extension was successfully linked.
[318 ServerApp] notebook | extension was successfully linked.
[478 ServerApp] notebook_shim | extension was successfully linked.
[488 ServerApp] WARNING: The Jupyter server is listening on all IP addresses and not using encryption. This is not recommended.
[488 ServerApp] notebook_shim | extension was successfully loaded.
[490 ServerApp] jupyter_lsp | extension was successfully loaded.
[490 ServerApp] jupyter_server_terminals | extension was successfully loaded.
[491 LabApp] JupyterLab extension loaded from /usr/local/lib/python3.10/dist-packages/jupyterlab
[491 LabApp] JupyterLab application directory is /usr/local/share/jupyter/lab
[492 LabApp] Extension Manager is 'pypi'.
[494 ServerApp] jupyterlab | extension was successfully loaded.
[495 ServerApp] notebook | extension was successfully loaded.
[496 ServerApp] The port 80 is already in use, trying another port.
[496 ServerApp] Serving notebooks from local directory: /usr/local/notebooks
[496 ServerApp] Jupyter Server 2.7.0 is running at:
[496 ServerApp] http://localhost:81/lab
[496 ServerApp] http://127.0.0.1:81/lab
[496 ServerApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[499 ServerApp] No web browser found: Error('could not locate runnable browser').
[513 ServerApp] Skipped non-installed server(s): bash-language-server, dockerfile-language-server-nodejs, javascript-typescript-langserver, jedi-language-server, julia-language-server, pyright, python-language-server, python-lsp-server, r-languageserver, sql-language-server, texlab, typescript-language-server, unified-language-server, vscode-css-languageserver-bin, vscode-html-languageserver-bin, vscode-json-languageserver-bin, yaml-language-server
[566 LabApp] 302 GET /lab (@192.168.0.42) 0.66ms
[609 ServerApp] User d3e21b90649743bf9e75a909ff5fc6f8 logged in.
[610 ServerApp] 302 POST /login?next=%2Flab (d3e21b90649743bf9e75a909ff5fc6f8@192.168.0.42) 59.69ms
[220 LabApp] Could not determine jupyterlab build status without nodejs
[487 ServerApp] interrupted
[487 ServerApp] Serving notebooks from local directory: /usr/local/notebooks

jupyter notebook 常用命令

1
2
3
4
5
6
# 帮助
$ jupyter notebook -h
# 指定端口
$ jupyter notebook --port <port_number>
# 启动时不自动打开浏览器
$ jupyter notebook --no-browser

jupyter notebook 配置

jupyter notebook 默认是home路径,上面很多私人文档文件,所以需修改默认目录

1
2
3
4
5
6
7
8
9
10
11
# 查看配置文件路径,如果没有配置文件会新生成一个
test@test-vm:~$ jupyter notebook --generate-config
Writing default config to: /home/test/.jupyter/jupyter_notebook_config.py
# vim编辑配置文件
test@test-vm:~$ vim /home/test/.jupyter/jupyter_notebook_config.py

# 找到 'notebook_dir' 关键字,设置路径
## The directory to use for notebooks and kernels.
# Default: ''
# c.NotebookApp.notebook_dir = ''
c.NotebookApp.notebook_dir = '/home/test/notebooks'

重启 jupyter notebook 服务,浏览器显示的就是当前设置的目录

远程连接

jupyter notebook 是一个web服务,默认仅支持在本地访问,通过修改配置文件,可支持其他PC远程访问。

可以在服务器部署,客户机在浏览器上使用。

1
2
3
4
5
6
# 允许远程连接
c.NotebookApp.allow_remote_access = True
# 所有IP可访问
c.NotebookApp.ip='*'
# 可选,如果是作为一个服务运行,则无需自动打开本地浏览器
c.NotebookApp.open_browser = False

重启 jupyter notebook 服务,拷贝日志输出的URL,里面带有token参数是身份认证。

设置密码

默认的Token值是很长一串字符,很难记忆,可配置为密码登录。

  1. 生成密码

    1
    2
    3
    4
    5
    6
    $ ipython
    In [1]: from notebook.auth import passwd
    In [2]: passwd()
    Enter password: (这里输入密码)
    Verify password: (这里再次输入密码)
    Out[2]: '密文' (这里是生成的密码加密数据)
  2. 密码放置到配置文件:

    1
    c.NotebookApp.password = u'密文'

    重启,刷新浏览器,输入密码登录。

安装插件

1
2
3
4
5
$ pip install jupyter_contrib_nbextensions
$ jupyter contrib nbextension install --user
$ pip install jupyter_nbextensions_configurator
$ jupyter nbextensions_configurator enable --user
# 重启jupyter失效
  1. 主页打开 Nbextensions 标签
  2. 取消勾选 disable configuration for nbextensions without explicit compatibility
  3. 勾选 Hinterland 代码不全
  4. 勾选 Code prettify 格式化代码

jupyter notebook 安装日志

备注: 此日志是桌边版的Ubuntu上安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
test@test-vm:~$ pip install jupyter
Defaulting to user installation because normal site-packages is not writeable
Collecting jupyter
Downloading jupyter-1.0.0-py2.py3-none-any.whl (2.7 kB)
Collecting qtconsole
Downloading qtconsole-5.4.3-py3-none-any.whl (121 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.9/121.9 KB 698.9 kB/s eta 0:00:00
Collecting ipykernel
Downloading ipykernel-6.23.3-py3-none-any.whl (152 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 152.8/152.8 KB 3.5 MB/s eta 0:00:00
Collecting notebook
Downloading notebook-6.5.4-py3-none-any.whl (529 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 529.8/529.8 KB 4.7 MB/s eta 0:00:00
Collecting jupyter-console
Downloading jupyter_console-6.6.3-py3-none-any.whl (24 kB)
Collecting ipywidgets
Downloading ipywidgets-8.0.6-py3-none-any.whl (138 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 138.3/138.3 KB 6.9 MB/s eta 0:00:00
Collecting nbconvert
Downloading nbconvert-7.6.0-py3-none-any.whl (290 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 290.4/290.4 KB 6.0 MB/s eta 0:00:00
Collecting comm>=0.1.1
Downloading comm-0.1.3-py3-none-any.whl (6.6 kB)
Collecting nest-asyncio
Downloading nest_asyncio-1.5.6-py3-none-any.whl (5.2 kB)
Collecting jupyter-client>=6.1.12
Downloading jupyter_client-8.3.0-py3-none-any.whl (103 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.2/103.2 KB 8.0 MB/s eta 0:00:00
Collecting pyzmq>=20
Downloading pyzmq-25.1.0-cp310-cp310-manylinux_2_28_x86_64.whl (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 6.2 MB/s eta 0:00:00
Collecting jupyter-core!=5.0.*,>=4.12
Downloading jupyter_core-5.3.1-py3-none-any.whl (93 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 93.7/93.7 KB 4.6 MB/s eta 0:00:00
Collecting ipython>=7.23.1
Downloading ipython-8.14.0-py3-none-any.whl (798 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 798.7/798.7 KB 5.6 MB/s eta 0:00:00
Collecting psutil
Downloading psutil-5.9.5-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (282 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 282.1/282.1 KB 6.1 MB/s eta 0:00:00
Collecting tornado>=6.1
Downloading tornado-6.3.2-cp38-abi3-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (426 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 426.9/426.9 KB 5.2 MB/s eta 0:00:00
Collecting traitlets>=5.4.0
Downloading traitlets-5.9.0-py3-none-any.whl (117 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.4/117.4 KB 5.0 MB/s eta 0:00:00
Collecting matplotlib-inline>=0.1
Downloading matplotlib_inline-0.1.6-py3-none-any.whl (9.4 kB)
Collecting packaging
Downloading packaging-23.1-py3-none-any.whl (48 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 KB 5.8 MB/s eta 0:00:00
Collecting debugpy>=1.6.5
Downloading debugpy-1.6.7-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.0/3.0 MB 5.8 MB/s eta 0:00:00
Collecting widgetsnbextension~=4.0.7
Downloading widgetsnbextension-4.0.7-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 5.9 MB/s eta 0:00:00
Collecting jupyterlab-widgets~=3.0.7
Downloading jupyterlab_widgets-3.0.7-py3-none-any.whl (198 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 198.2/198.2 KB 5.9 MB/s eta 0:00:00
Collecting prompt-toolkit>=3.0.30
Downloading prompt_toolkit-3.0.38-py3-none-any.whl (385 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 385.8/385.8 KB 6.6 MB/s eta 0:00:00
Collecting pygments
Downloading Pygments-2.15.1-py3-none-any.whl (1.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 7.3 MB/s eta 0:00:00
Collecting beautifulsoup4
Downloading beautifulsoup4-4.12.2-py3-none-any.whl (142 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.0/143.0 KB 6.4 MB/s eta 0:00:00
Collecting nbclient>=0.5.0
Downloading nbclient-0.8.0-py3-none-any.whl (73 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.1/73.1 KB 8.5 MB/s eta 0:00:00
Collecting mistune<4,>=2.0.3
Downloading mistune-3.0.1-py3-none-any.whl (47 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.0/48.0 KB 13.5 MB/s eta 0:00:00
Collecting jupyterlab-pygments
Downloading jupyterlab_pygments-0.2.2-py2.py3-none-any.whl (21 kB)
Collecting bleach!=5.0.0
Downloading bleach-6.0.0-py3-none-any.whl (162 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 162.5/162.5 KB 8.1 MB/s eta 0:00:00
Requirement already satisfied: jinja2>=3.0 in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (3.1.2)
Requirement already satisfied: markupsafe>=2.0 in ./.local/lib/python3.10/site-packages (from nbconvert->jupyter) (2.1.3)
Collecting nbformat>=5.7
Downloading nbformat-5.9.0-py3-none-any.whl (77 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.6/77.6 KB 8.1 MB/s eta 0:00:00
Collecting defusedxml
Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB)
Collecting pandocfilters>=1.4.1
Downloading pandocfilters-1.5.0-py2.py3-none-any.whl (8.7 kB)
Collecting tinycss2
Downloading tinycss2-1.2.1-py3-none-any.whl (21 kB)
Collecting Send2Trash>=1.8.0
Downloading Send2Trash-1.8.2-py3-none-any.whl (18 kB)
Collecting prometheus-client
Downloading prometheus_client-0.17.0-py3-none-any.whl (60 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.6/60.6 KB 4.2 MB/s eta 0:00:00
Collecting nbclassic>=0.4.7
Downloading nbclassic-1.0.0-py3-none-any.whl (10.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.0/10.0 MB 6.6 MB/s eta 0:00:00
Collecting ipython-genutils
Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB)
Collecting argon2-cffi
Downloading argon2_cffi-21.3.0-py3-none-any.whl (14 kB)
Collecting terminado>=0.8.3
Downloading terminado-0.17.1-py3-none-any.whl (17 kB)
Collecting qtpy>=2.0.1
Downloading QtPy-2.3.1-py3-none-any.whl (84 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 84.9/84.9 KB 10.4 MB/s eta 0:00:00
Requirement already satisfied: six>=1.9.0 in /usr/lib/python3/dist-packages (from bleach!=5.0.0->nbconvert->jupyter) (1.16.0)
Collecting webencodings
Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB)
Collecting stack-data
Downloading stack_data-0.6.2-py3-none-any.whl (24 kB)
Collecting pickleshare
Downloading pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB)
Collecting jedi>=0.16
Downloading jedi-0.18.2-py2.py3-none-any.whl (1.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.6/1.6 MB 6.7 MB/s eta 0:00:00
Collecting backcall
Downloading backcall-0.2.0-py2.py3-none-any.whl (11 kB)
Requirement already satisfied: pexpect>4.3 in /usr/lib/python3/dist-packages (from ipython>=7.23.1->ipykernel->jupyter) (4.8.0)
Collecting decorator
Downloading decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting python-dateutil>=2.8.2
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 KB 5.6 MB/s eta 0:00:00
Collecting platformdirs>=2.5
Downloading platformdirs-3.8.0-py3-none-any.whl (16 kB)
Collecting notebook-shim>=0.2.3
Downloading notebook_shim-0.2.3-py3-none-any.whl (13 kB)
Collecting jupyter-server>=1.8
Downloading jupyter_server-2.7.0-py3-none-any.whl (375 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 375.1/375.1 KB 6.9 MB/s eta 0:00:00
Collecting fastjsonschema
Downloading fastjsonschema-2.17.1-py3-none-any.whl (23 kB)
Collecting jsonschema>=2.6
Downloading jsonschema-4.17.3-py3-none-any.whl (90 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.4/90.4 KB 8.2 MB/s eta 0:00:00
Collecting wcwidth
Downloading wcwidth-0.2.6-py2.py3-none-any.whl (29 kB)
Requirement already satisfied: ptyprocess in /usr/lib/python3/dist-packages (from terminado>=0.8.3->notebook->jupyter) (0.7.0)
Collecting argon2-cffi-bindings
Downloading argon2_cffi_bindings-21.2.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (86 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 86.2/86.2 KB 8.7 MB/s eta 0:00:00
Collecting soupsieve>1.2
Downloading soupsieve-2.4.1-py3-none-any.whl (36 kB)
Collecting parso<0.9.0,>=0.8.0
Downloading parso-0.8.3-py2.py3-none-any.whl (100 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.8/100.8 KB 9.6 MB/s eta 0:00:00
Collecting attrs>=17.4.0
Downloading attrs-23.1.0-py3-none-any.whl (61 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 KB 7.1 MB/s eta 0:00:00
Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0
Downloading pyrsistent-0.19.3-py3-none-any.whl (57 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.5/57.5 KB 10.0 MB/s eta 0:00:00
Collecting jupyter-events>=0.6.0
Downloading jupyter_events-0.6.3-py3-none-any.whl (18 kB)
Collecting overrides
Downloading overrides-7.3.1-py3-none-any.whl (17 kB)
Collecting websocket-client
Downloading websocket_client-1.6.1-py3-none-any.whl (56 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.9/56.9 KB 5.7 MB/s eta 0:00:00
Collecting anyio>=3.1.0
Downloading anyio-3.7.0-py3-none-any.whl (80 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.9/80.9 KB 5.6 MB/s eta 0:00:00
Collecting jupyter-server-terminals
Downloading jupyter_server_terminals-0.4.4-py3-none-any.whl (13 kB)
Collecting cffi>=1.0.1
Downloading cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 441.8/441.8 KB 4.8 MB/s eta 0:00:00
Collecting asttokens>=2.1.0
Downloading asttokens-2.2.1-py2.py3-none-any.whl (26 kB)
Collecting executing>=1.2.0
Downloading executing-1.2.0-py2.py3-none-any.whl (24 kB)
Collecting pure-eval
Downloading pure_eval-0.2.2-py3-none-any.whl (11 kB)
Collecting exceptiongroup
Downloading exceptiongroup-1.1.1-py3-none-any.whl (14 kB)
Collecting sniffio>=1.1
Downloading sniffio-1.3.0-py3-none-any.whl (10 kB)
Requirement already satisfied: idna>=2.8 in /usr/lib/python3/dist-packages (from anyio>=3.1.0->jupyter-server>=1.8->nbclassic>=0.4.7->notebook->jupyter) (3.3)
Collecting pycparser
Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 KB 7.6 MB/s eta 0:00:00
Collecting python-json-logger>=2.0.4
Downloading python_json_logger-2.0.7-py3-none-any.whl (8.1 kB)
Collecting rfc3986-validator>=0.1.1
Downloading rfc3986_validator-0.1.1-py2.py3-none-any.whl (4.2 kB)
Requirement already satisfied: pyyaml>=5.3 in /usr/lib/python3/dist-packages (from jupyter-events>=0.6.0->jupyter-server>=1.8->nbclassic>=0.4.7->notebook->jupyter) (5.4.1)
Collecting rfc3339-validator
Downloading rfc3339_validator-0.1.4-py2.py3-none-any.whl (3.5 kB)
Collecting webcolors>=1.11
Downloading webcolors-1.13-py3-none-any.whl (14 kB)
Collecting fqdn
Downloading fqdn-1.5.1-py3-none-any.whl (9.1 kB)
Collecting isoduration
Downloading isoduration-20.11.0-py3-none-any.whl (11 kB)
Collecting uri-template
Downloading uri_template-1.3.0-py3-none-any.whl (11 kB)
Collecting jsonpointer>1.13
Downloading jsonpointer-2.4-py2.py3-none-any.whl (7.8 kB)
Collecting arrow>=0.15.0
Downloading arrow-1.2.3-py3-none-any.whl (66 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 66.4/66.4 KB 3.6 MB/s eta 0:00:00
Installing collected packages: webencodings, wcwidth, pure-eval, pickleshare, ipython-genutils, fastjsonschema, executing, backcall, widgetsnbextension, websocket-client, webcolors, uri-template, traitlets, tornado, tinycss2, soupsieve, sniffio, Send2Trash, rfc3986-validator, rfc3339-validator, pyzmq, python-json-logger, python-dateutil, pyrsistent, pygments, pycparser, psutil, prompt-toolkit, prometheus-client, platformdirs, parso, pandocfilters, packaging, overrides, nest-asyncio, mistune, jupyterlab-widgets, jupyterlab-pygments, jsonpointer, fqdn, exceptiongroup, defusedxml, decorator, debugpy, bleach, attrs, asttokens, terminado, stack-data, qtpy, matplotlib-inline, jupyter-core, jsonschema, jedi, comm, cffi, beautifulsoup4, arrow, anyio, nbformat, jupyter-server-terminals, jupyter-client, isoduration, ipython, argon2-cffi-bindings, nbclient, ipykernel, argon2-cffi, qtconsole, nbconvert, jupyter-events, jupyter-console, ipywidgets, jupyter-server, notebook-shim, nbclassic, notebook, jupyter
Successfully installed Send2Trash-1.8.2 anyio-3.7.0 argon2-cffi-21.3.0 argon2-cffi-bindings-21.2.0 arrow-1.2.3 asttokens-2.2.1 attrs-23.1.0 backcall-0.2.0 beautifulsoup4-4.12.2 bleach-6.0.0 cffi-1.15.1 comm-0.1.3 debugpy-1.6.7 decorator-5.1.1 defusedxml-0.7.1 exceptiongroup-1.1.1 executing-1.2.0 fastjsonschema-2.17.1 fqdn-1.5.1 ipykernel-6.23.3 ipython-8.14.0 ipython-genutils-0.2.0 ipywidgets-8.0.6 isoduration-20.11.0 jedi-0.18.2 jsonpointer-2.4 jsonschema-4.17.3 jupyter-1.0.0 jupyter-client-8.3.0 jupyter-console-6.6.3 jupyter-core-5.3.1 jupyter-events-0.6.3 jupyter-server-2.7.0 jupyter-server-terminals-0.4.4 jupyterlab-pygments-0.2.2 jupyterlab-widgets-3.0.7 matplotlib-inline-0.1.6 mistune-3.0.1 nbclassic-1.0.0 nbclient-0.8.0 nbconvert-7.6.0 nbformat-5.9.0 nest-asyncio-1.5.6 notebook-6.5.4 notebook-shim-0.2.3 overrides-7.3.1 packaging-23.1 pandocfilters-1.5.0 parso-0.8.3 pickleshare-0.7.5 platformdirs-3.8.0 prometheus-client-0.17.0 prompt-toolkit-3.0.38 psutil-5.9.5 pure-eval-0.2.2 pycparser-2.21 pygments-2.15.1 pyrsistent-0.19.3 python-dateutil-2.8.2 python-json-logger-2.0.7 pyzmq-25.1.0 qtconsole-5.4.3 qtpy-2.3.1 rfc3339-validator-0.1.4 rfc3986-validator-0.1.1 sniffio-1.3.0 soupsieve-2.4.1 stack-data-0.6.2 terminado-0.17.1 tinycss2-1.2.1 tornado-6.3.2 traitlets-5.9.0 uri-template-1.3.0 wcwidth-0.2.6 webcolors-1.13 webencodings-0.5.1 websocket-client-1.6.1 widgetsnbextension-4.0.7
test@test-vm:~$
test@test-vm:~$
test@test-vm:~$
test@test-vm:~$

# 启动
test@test-vm:~$ jupyter notebook
[I 14:37:19.716 NotebookApp] Writing notebook server cookie secret to /home/test/.local/share/jupyter/runtime/notebook_cookie_secret

_ _ _ _
| | | |_ __ __| |__ _| |_ ___
| |_| | '_ \/ _` / _` | _/ -_)
\___/| .__/\__,_\__,_|\__\___|
|_|

Read the migration plan to Notebook 7 to learn about the new features and the actions to take if you are using extensions.

https://jupyter-notebook.readthedocs.io/en/latest/migrate_to_notebook7.html

Please note that updating to Notebook 7 might break some of your extensions.

[I 14:37:19.976 NotebookApp] Serving notebooks from local directory: /home/test
[I 14:37:19.976 NotebookApp] Jupyter Notebook 6.5.4 is running at:
[I 14:37:19.977 NotebookApp] http://localhost:8888/?token=eff1fc5fd6b900077d0c1d6a05594d665bfbf506eb72306d
[I 14:37:19.977 NotebookApp] or http://127.0.0.1:8888/?token=eff1fc5fd6b900077d0c1d6a05594d665bfbf506eb72306d
[I 14:37:19.977 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).