• jupyter 服务器安装随笔


    python3:
    python3 -m pip install --upgrade pip python3 -m pip install jupyter
    pkg install py36-pyzmq-18.0.1
    freeBSD需要安装py*-sqlite3、需要安装py*-pyzmq
     jupyter notebook --generate-config

    该命令会在用户目录下创建一个配置目录.jupyter目录里会看到一个jupyter_notebook_config.py
    主要的配置项:
      
    # 登录密码,默认没有密码,所以每次启动服务器后都会产生一个随机数token,配置了密码后就不用每次使用随机数token了
    c.NotebookApp.password = ''"(此处密码并非明文密码)
    #开启远程登录
    c.NotebookApp.ip='0.0.0.0'#notebook版本低于5.8则用*代替0.0.0.0
    # 服务的端口,用默认的8888即可 
    c.NotebookApp.port = 8888
    # 是否需要自动弹出浏览器,服务器端一般不需要
    c.NotebookApp.open_browser = False ## The directory to use for notebooks and kernels.
    # 不设置的话就是启动命令所在的目录
    c.NotebookApp.notebook_dir = '/home/find/work'
    #设置密码
    c.NotebookApp.password='sha1:XXXXXXX'
    #隐藏推出按钮
    c.NotebookApp.quit_button=False

    密码生成

    c.NotebookApp.password配置的并非明文密码,按照配置文件上的注释步骤生成:

    1. 在命令行下输入ipython,进入REPL环境
    2. 执行:from notebook.auth import passwd;passwd()
    3. 根据提示输入明文密码
    4. 生成hash后的密码类似如下:
    In [2]: from notebook.auth import passwd; passwd()
    Enter password:
    Verify password:
    Out[2]: 'sha1:e4ac9ea2e432:ce17c208cac9c15c59dd6f34ffe2a262f6d65bf3'
    

    将sha1开头的一串字符,拷贝到c.NotebookApp.password字段即可。这样再次启动jupyter时,就有了密码输入界面。

    jupyterlab安装与notebook安装时更改配置文件设置密码等都相同,区别代码如下:

    pip install jupyterlab

    pkg install node npm -y

    查看已安装插件:jupyter labextension list

    更新已安装插件:jupyter labextension update --all

     jupyter labextension install @jupyterlab/toc

    jupyter labextension install @ryantam626/jupyterlab_code_formatter  #--no-build参数可不编译等待统一编译#jupyter lab build  #(jupyter lab build  --minimize=False)
    pip install jupyterlab_code_formatter ;jupyter serverextension enable --py jupyterlab_code_formatter

    启动
    jupyter lab

    修复pip
    curl https://bootstrap.pypa.io/get-pip.py | python3

    freebsd install lxml
    pkg install libxslt
    pkg install libxml2 py*-libxml2
    pip install lxml

    #install jupyter-lsp
    pip install jupyter-lsp
    jupyter labextension install @krassowski/jupyterlab-lsp
    jupyter lab build --minimize=False#在jupyter lab build 错误时可用
  • 相关阅读:
    Ubuntu把在任事器范围起更次要的脚色
    linux下firefox 3.0 flash失效的治理法子
    Fedora的一些根蒂设置装备摆设(三、有关Firefox的放慢设置装备摆设)
    Linux操纵零碎下即时通讯软件
    QGtkStyle 让 KDE 法式拥有 Gnome 外不雅
    Ubuntu 8.04 告白登岸德国柏林的地铁零碎
    关于linux的一些重要日记文件
    linux下挂载U盘进程
    对Fedora9的一些心得领会(另附一些末尾设置装备安插)
    使用distinct在mysql中查询多条不重复记载值的处理责罚步调
  • 原文地址:https://www.cnblogs.com/defifind/p/10824907.html
Copyright © 2020-2023  润新知