在远程服务器安装jupyter notebook并在本地电脑使用
下面的步骤中写了配置ssh,个人觉得没必要,因为浏览器可能不信任这个证书或者证书过去得更新。1Python ssl socket server SSLV3_ALERT_CERTIFICATE_UNKNOWN issue

具体步骤参考:
https://www.cnblogs.com/thousfeet/p/10647102.html

1.切换到虚拟环境下安装jupyter notebook

pip install notebook

2.配置

1)生成配置文件

jupyter notebook --generate-config

在linux下的路径一般是“/home/USERNAME/.jupyter/jupyter_notebook_config.py”。
2)配置密码

jupyter notebook password
Enter password:  ****
Verify password: ****
[NotebookPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_notebook_config.json

3)配置访问设置

# Set ip to '*' to bind on all interfaces (ips) for the public server
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
# It is a good idea to set a known, fixed port for server access
c.NotebookApp.port = 8888
c.NotebookApp.notebook_dir = '/root/jupyter_projects' #这里是设置Jupyter的根目录
c.NotebookApp.allow_root = True # 为了安全,Jupyter默认不允许以root权限启动jupyter 

3.后台运行

nohup jupyter notebook&

4.在本地输入服务器ip:8888,输入刚才设置的密码访问

5.关闭进程
1)查看当前所有TCP端口

netstat -ntlp 

pid

2)

kill pid号
Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐