zoukankan      html  css  js  c++  java
  • ubantu 配置远程连接jupyter lab/notebook 后台挂起

    1、服务器安装JupyterLab
    这里推荐直接安装Anaconda,安装好后可以通过命令jupyter lab打开测试一下。

    2、生成配置文件

    $jupyter notebook --generate-config

    生成密码 此处的密码可由自己随意设定 保存好 返回的sha1字符串
    $ python
    Python 3.7.3 (default, Mar 27 2019, 22:11:17)
    [GCC 7.3.0] :: Anaconda, Inc. on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from notebook.auth import passwd
    >>> passwd()
    Enter password:
    Verify password:
    'sha1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'

    4. 修改默认配置文件
    $vim ~/.jupyter/jupyter_notebook_config.py'

    # 将ip设置为*,意味允许任何IP访问
    c.NotebookApp.ip = ‘*# 这里的密码就是上边我们生成的那一串
    c.NotebookApp.password = ‘sha1:f704b702aea2:01e2bd991f9c7208ba177b46f4d10b6907810927‘ 
    # 服务器上并没有浏览器可以供Jupyter打开 
    c.NotebookApp.open_browser = False 
    # 监听端口设置为8888或其他自己喜欢的端口 
    c.NotebookApp.port = 8888
    # 允许远程访问 
    c.NotebookApp.allow_remote_access = True
    c.NotebookApp.notebook_dir = '默认打开目录'

    5.后台运行: nohup jupyter notebook --allow-root > jupyter.log 2>&1 &

     关闭:

    ps -ef | grep jupyter

    kill -9 ID

     
  • 相关阅读:
    Windows 上 Redis 的安装
    SpringBoot项目application.yml 问题
    Gradle项目使用zxing在windows下报错:android:jar must specify an absolute path but is /${env.ANDROID_HOME}/…
    day23<AJAX>
    day22<文件上传>
    day21<过滤器>
    day20<监听器&国际化>
    day19<Service>
    day18<事务&连接池&DBUtils>
    day17<JDBC>
  • 原文地址:https://www.cnblogs.com/zzuuoo666/p/13884503.html
Copyright © 2011-2022 走看看