小淼博客

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

一、安装Jupyter Notebook

直接使用命令行进行安装,如下所示:

sudo pip install jupyter

可能存在的问题是 ipython 的版本不匹配的问题,可以直接安装 ipython ,然后再安装 jupyter.

sudo pip3 install ipython

二、配置Jupyter Notebook使能远程访问功能

1. 生成 jupyter 配置文件

jupyter notebook --generate-config

2. 通过 ipython 设置网页远程登陆密码

mm@ubuntu-MS:~$ ipython3
Python 3.6.9 (default, Dec  8 2021, 21:08:43)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.3 -- An enhanced Interactive Python. Type '?' for help.

In [1]: from notebook.auth import passwd

In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'argon2:$argon2id$v=19$m=102xxxxxxxxxxxvWbbr1AxxxxxxnOgPL2xxxxxxxxxxaq'

In [3]: exit()

3. 修改 jupyter 配置文件

  1. 打开编辑 jupyter_notebook_config.py 文件
    sudo vim ~/.jupyter/jupyter_notebook_config.py
  2. 在文件的最后末尾位置添加如下内容:
    c.NotebookApp.ip='*'
    c.NotebookApp.password='argon2:$argon2id$v=19$m=102xxxxxxxxxxxvWbbr1AxxxxxxnOgPL2xxxxxxxxxxaq'
    c.NotebookApp.open_browser = False
    c.NotebookApp.port =8888
    c.IPKernelApp.pyplot = 'inline'
    c.NotebookApp.allow_remote_access = True
    
  3. 保存退出启动 jupyter notebook
    jupyter notebook

三、登录测试

  1. 在局域网其他主机上打开浏览器输入运行 jupyter notebook 的主机 IP

    http://192.168.xx.xx:8888

  2. 进入登陆界面
    image

  3. 登陆如下图所示:
    image

Reference

https://blog.csdn.net/zds13257177985/article/details/128022829

posted on 2023-05-06 13:00  小淼博客  阅读(1233)  评论(0)    收藏  举报

大家转载请注明出处!谢谢! 在这里要感谢GISPALAB实验室的各位老师和学长学姐的帮助!谢谢~