我在 python GCP VM 中运行 ML 模型,结果(可视化)存储在 jupyter 笔记本中。因此,我将 jupyter 笔记本安装到 ubuntu 虚拟机,并使用
jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser
命令从相关位置运行 jupyter。它给出了这个输出
_ _ _ _
| | | |_ __ __| |__ _| |_ ___
| |_| | '_ \/ _` / _` | _/ -_)
\___/| .__/\__,_\__,_|\__\___|
|_|
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:16:46.732 NotebookApp] Registered dataproc_jupyter_plugin server extension
jupyter_http_over_ws extension initialized. Listening on /http_over_websocket
[W 14:16:47.328 NotebookApp] Loading JupyterLab as a classic notebook (v6) extension.
[C 14:16:47.328 NotebookApp] You must use Jupyter Server v1 to load JupyterLab as notebook extension. You have v2.12.5 installed.
You can fix this by executing:
pip install -U "jupyter-server<2.0.0"
[I 14:16:47.406 NotebookApp] [Jupytext Server Extension] Deriving a JupytextContentsManager from LargeFileManager
[I 14:16:47.628 NotebookApp] [nb_conda] enabled
[C 14:16:47.676 NotebookApp] You must use Jupyter Server v1 to load nbdime as a classic notebook server extension. You have v2.12.5 installed.
You can fix this by executing:
pip install -U "jupyter-server<2.0.0"
[I 14:16:47.678 NotebookApp] Serving notebooks from local directory: current_terminal_location
[I 14:16:47.678 NotebookApp] Jupyter Notebook 6.5.6 is running at:
[I 14:16:47.678 NotebookApp] http://base_url:8888/?token=token_value
[I 14:16:47.678 NotebookApp] or http://#.#.#.#:8888/?token=token_value
[I 14:16:47.678 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
[C 14:16:47.681 NotebookApp]
To access the notebook, open this file in a browser:
file:///path_to_jupyter_runtime/nbserver-684890-open.html
Or copy and paste one of these URLs:
http://base_url:8888/?token=token_value
or http://#.#.#.#:8888/?token=token_value
无论如何,当我尝试访问给定的链接时:
http://base_url:8888/?token=token_value
or http://#.#.#.#:8888/?token=token_value
jupytor 笔记本未加载,浏览器显示无法访问该页面
我做了两件事
jupyter notebook --generate-config
确保使用 在位置
jupyter_notebook_config.py
生成
/.jupyter/jupyter_notebook_config.py
sudo vi /home/user_name/.jupyter/jupyter_notebook_config.py
在 vi 编辑器中添加了以下几行
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
c.NotebookApp.port = 8888
通过 esc + :wq 命令退出 vi 编辑器
然后运行相同的命令
jupyter notebook --ip=0.0.0.0 --port=8888 --no-browser
没有什么新的,相同的结果 我错过了什么
尝试访问 Jupyter Notebook 时,将 URL 中的 base_url 和 token_value 替换为实际值。 base_url应该是您虚拟机的外部IP,token_value是启动Jupyter笔记本时生成的令牌。