• Linux上部署Jupyter notebook


    安装jupyter notebook

    pip install notebook 
    #或者
    conda install notebook
    
    • 1
    • 2
    • 3

    配置

    jupyter notebook --generate-config
    
    
    • 1
    • 2
    ## The IP address the notebook server will listen on.
    #  Default: 'localhost'
    # 设置可以访问的ip, 默认是localhost, 将其改为 '*'
    c.NotebookApp.ip = '*'
    
    
    ## The directory to use for notebooks and kernels.
    #  Default: ''
    # 默认打开目录
    c.NotebookApp.notebook_dir = '/home/data123share66/python'
    
    
    ## Whether to open in a browser after starting.
    #                          The specific browser used is platform dependent and
    #                          determined by the python standard library `webbrowser`
    #                          module, unless it is overridden using the --browser
    #                          (NotebookApp.browser) configuration option.
    #  Default: True
    # Jupyter notebook启动后是否打开浏览器, 设为 False 即可
    c.NotebookApp.open_browser = False
    
    
    ## Hashed password to use for web authentication.
    #  
    #                        To generate, type in a python/IPython shell:
    #  
    #                          from notebook.auth import passwd; passwd()
    #  
    #                        The string should be of the form type:salt:hashed-
    #  password.
    #  Default: ''
    c.NotebookApp.password = 'argon2:$argon2id$v=19$m=10240,t=10,p=8$Ny6WDdoLBm88cUMyOqgNqg$s3WObP81eU51RT2j8D8DULPM1OAPOnzYfODW8olB0xw'
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33

    密码设置

    1、运行python
    2、命令:from notebook.auth import passwd; passwd()
    3、copy 密码
    
    • 1
    • 2
    • 3

    扩展插件

    pip install jupyter_contrib_nbextensions
    
    jupyter-contrib-nbextension install --user
    
    • 1
    • 2
    • 3

    在这里插入图片描述

    后台运行

    1、tmux new -s jupyter
    
    2、jupyter notebook --ip=0.0.0.0 --port=9999 --allow-root
    
    3、然后我们按住快捷键Ctrl+b,松开,再按一下d。我们就把这个会话放到了后台。
    
    4、返回窗口:tmux attach -t jupyter
    
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8

    使用

    在浏览器输入服务器的IP地址:9999,小编这里是34.81.173.39:9999,访问

    参考

    https://blog.csdn.net/zhangtingduo/article/details/133945890
    https://baijiahao.baidu.com/s?id=1759085502704856128&wfr=spider&for=pc

  • 相关阅读:
    ChatGPT、AIGC、大语言模型都是啥?
    Java 服务 Docker 容器化最佳实践
    网络安全相关
    JVM学习-类加载过程(一)
    国产FPGA核心板!米尔紫光同创Logos-2和Xilinx Artix-7核心板
    MobLink后台基本配置
    ROS melodic 中同时使用python2 和python3
    不让selenium自动关闭浏览器页面(闪崩)[vscode +edge]
    自动化测试系列 —— UI测试
    二维列表对应一维列表的内容子串查询,并返回下标
  • 原文地址:https://blog.csdn.net/sunghosts/article/details/138156773