【问题标题】:Google Dataproc Jupyter notebook thinks its in rootGoogle Dataproc Jupyter notebook 认为它是根目录
【发布时间】:2021-07-21 04:52:53
【问题描述】:

Google Dataproc 上的所有笔记本在运行 !pwdos.getcwd() 时都会返回根目录 /。它们实际上位于文件系统上更深的位置,例如:/jupyter/users。此问题似乎特定于 Google Dataproc。有什么想法可以获取位置吗?

我尝试更改启动 jupyter 服务器的命令,但笔记本只是认为路径是它们所在的位置。

/opt/conda/miniconda3/bin/jupyter notebook /root/ &> /var/log/jupyter_notebook.log

现在所有文件都认为它们位于/root/

【问题讨论】:

    标签: jupyter-notebook jupyter jupyter-lab google-cloud-dataproc


    【解决方案1】:

    /etc/jupyter/jupyter_notebook_config.py 中添加这些为我解决了这个问题:

    c.NotebookApp.contents_manager_class = 'notebook.services.contents.filemanager.FileContentsManager'
    c.NotebookApp.notebook_dir = '/jupyter/notebooks'
    c.FileContentsManager.root_dir = '/jupyter/notebooks'
    

    当您的笔记本文件从 /jupyter/notebooks 提供时有效

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-14
      • 1970-01-01
      • 2016-11-29
      • 2021-07-16
      • 2019-07-30
      • 1970-01-01
      • 2016-07-25
      • 2017-08-11
      相关资源
      最近更新 更多