Jupyter远程服务器设置

Jupyter远程服务器设置

此文来自 Jupyter 开启远程服务器

最近在做 AI 方面的研究,用到了 python。使用python编辑器或者vim 在遇到输入错误需要重新输入的时候,会感觉很别扭,尤其是在 for 循环等中。而 jupyter 可以实现文本编辑并运行的效果,对我而言提高了效率。

安装 Jupyter

pip install notebook jupyterlab

设置密码

自动设置

$  jupyter server password
Enter password:  ****
Verify password: ****
[JupyterPasswordApp] Wrote hashed password to /Users/you/.jupyter/jupyter_server_config.json

手动设置
打开python,输入以下语句:

from jupyter_server.auth import passwd
passwd()
Enter password:
Verify password:
'sha1:67c9e60bb8b6:9ffede0825894254b2e042ea597d771089e11aed'

生成配置文件

$  jupyter server --generate-config
Writing default config to: /root/.jupyter/jupyter_server_config.py

修改配置文件

打开 jupyter_notebook_config.py, 修改里面的:

c.ServerApp.allow_remote_access = True
c.ServerApp.allow_root = True
# 开启远程访问ip
c.ServerApp.ip = '*'
c.ServerApp.open_browser = False
c.ServerApp.password_required = True
# 使用自动设置密码,则此处不需要配置手动密码
c.ServerApp.password = ''
设置端口号
c.ServerApp.port = 9999
# notebook存储目录
c.ServerApp.notebook_dir = '/root/app/jupyter'

启动Jupyter

在命令行输入 jupyter notebook就可以开启服务了。但我们一般希望Jupyter Notebook在后台运行,所以可以输入以下命令

$ nohup jupyter notebook --allow-root >/dev/null 2>&1 &
启动juypterlab:
$ nohup jupyter lab --allow-root >/dev/null 2>&1 &

因为 jupyterlab中包含jupyter notebook, 所以启动jupyterlab,则同时也启动了jupyter notebook.

参考文档

Jupyter 开启远程服务器(最新版)

相关推荐

  1. Jupyter远程服务器设置

    2024-07-12 08:02:04       28 阅读
  2. 远程访问服务器Jupyter Notebook

    2024-07-12 08:02:04       57 阅读
  3. 如何在vscode下,启动jupyter连接远程服务器

    2024-07-12 08:02:04       57 阅读
  4. 本地远程访问Linux服务器上的jupyter notebook

    2024-07-12 08:02:04       36 阅读
  5. SSH远程直连服务器docker容器的jupyter

    2024-07-12 08:02:04       34 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-07-12 08:02:04       70 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-07-12 08:02:04       74 阅读
  3. 在Django里面运行非项目文件

    2024-07-12 08:02:04       62 阅读
  4. Python语言-面向对象

    2024-07-12 08:02:04       72 阅读

热门阅读

  1. 基于K线图的股市情绪分析及预测模型构建

    2024-07-12 08:02:04       33 阅读
  2. Android Retrofit post请求,@Body传递的参数转义问题

    2024-07-12 08:02:04       29 阅读
  3. Spring MVC 全面指南:从入门到精通的详细解析

    2024-07-12 08:02:04       29 阅读
  4. 每日一道算法题 204. 计数质数

    2024-07-12 08:02:04       29 阅读
  5. 初识c++

    初识c++

    2024-07-12 08:02:04      25 阅读
  6. HTTP有哪些失败原因?怎么处理?

    2024-07-12 08:02:04       35 阅读
  7. 小白学webgl合集-import.meta.url 和 new URL() bug

    2024-07-12 08:02:04       33 阅读
  8. Excel中用VBA实现Outlook发送当前工作簿

    2024-07-12 08:02:04       31 阅读
  9. Openresty+lua 定时函数 ngx.timer.every

    2024-07-12 08:02:04       23 阅读
  10. 1.Introduction to Spring Web MVC framework

    2024-07-12 08:02:04       29 阅读
  11. 【layui表单赋值为空问题查找】

    2024-07-12 08:02:04       26 阅读