jupyter notebook远程连接服务器配置教程

1.安装anaconda

默认服务器上安装好了conda环境和jupyter notebook

2.生成默认配置文件

默认情况下,配置文件 ~/.jupyter/jupyter_notebook_config.py 并不存在,需要自行创建。使用下列命令生成配置文件:

jupyter notebook --generate-config

电脑显示如下:

(base) C:\Users\1>jupyter notebook --generate-config
Writing default config to: C:\Users\1\.jupyter\jupyter_notebook_config.py

3.生成秘钥

ipython
In [1]: from notebook.auth import passwd

In [2]: passwd()
Enter password:
Verify password:
Out[2]: 'argon2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

In [3]: exit

4.要添加的密码

c.NotebookApp.password = u'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'

5.修改配置文件

在 jupyter_notebook_config.py 中找到下面的行,取消注释并修改。

c.NotebookApp.ip='*'
c.NotebookApp.allow_remote_access = True
c.NotebookApp.password = u'sha:ce...刚才复制的那个密文'
c.NotebookApp.open_browser = False
c.NotebookApp.port =8888 #可自行指定一个端口, 访问时使用该端口

6.只打开特定文件夹

c.NotebookApp.notebook_dir = ''

7.查询电脑ip

1.使用Windows+R键打开“运行”窗口,然后输入CMD进入命令提示窗口.
2.进入命令窗口之后,输入:

ipconfig

查找

IPv4 地址

猜你喜欢

转载自blog.csdn.net/weixin_43818488/article/details/118307277