jupyter筆記

badwood發表於2024-03-30

1、安裝:透過conda安裝。

  • 新建虛擬環境:conda install -n jupyter python=3.10  #一開始用的3.11.8,各種不服,最終發現有個元件需要<3.11
  • 進入虛擬環境:conda activate jupyter
  • 安裝:conda install jupyterlab
  • 補全:根據執行時報錯安裝缺失的元件:conda install jupyter_server_fileid jupyter_server_ydoc nbclassic nodejs
  • 配置:~/.jupyter/jupyter_lab_config.py:
    • c.ServerApp.allow_origin = '*'
    • c.ServerApp.ip = '0.0.0.0'
    • c.ServerApp.root_dir = '/app1/samples'
    • c.ServerApp.password_required = True
    • c.ServerApp.password = '密碼串'  #密碼串透過執行命令來生成:python3 -c "from jupyter_server.auth import passwd; print(passwd())"

2、執行:nohup jupyter lab 1>/dev/null 2>/dev/null &

相關文章