【问题标题】:Jupyterlab extension jupyterlab_templates not finding template filesJupyterlab 扩展 jupyterlab_templates 找不到模板文件
【发布时间】:2022-02-13 21:04:31
【问题描述】:

我正在尝试使用 jupyterlab_templates 扩展名。出于某种原因,即使我设置了正确的路径,它也没有找到相应的模板文件? 在运行jupyter lab 时,它会找到扩展名并确认我设置的搜索路径,但没有找到任何文件:

[I 2022-01-11 18:10:09.108 ServerApp] jupyterlab_templates | extension was successfully loaded.
Installing jupyterlab_templates handler on path /templates
Search paths:
    /Users/emilaz/.jupyter/templates
Available templates:

[I 2022-01-11 18:10:09.108 ServerApp] jupyterlab_templates.extension | extension was successfully loaded.

/Users/my_username/.jupyter/templates 的内容如下所示:

$ ls /Users/emilaz/.jupyter/templates
new_template.ipynb  some_template.ipynb

这是我的jupyter_notebook_config.py 文件:

c.JupyterLabTemplates.template_dirs = ['/Users/emilaz/.jupyter/templates']
c.JupyterLabTemplates.include_default = False
c.JupyterLabTemplates.include_core_paths = False

我试过了

  1. 取消并重新安装jupyterlabjupyterlab_templates
  2. 将模板文件的权限更改为 660
  3. 在这两个文件上运行 jupyter trust
  4. 将文件移动到别处(在非隐藏文件夹中)

然后我尝试包含默认模板(设置c.JupyterLabTemplates.include_default=Truec.JupyterLabTemplates.include_core_paths=True)。这使得示例模板可供选择。然后我尝试将我自己的.ipynb 文件移动到与示例模板ipynb 相同的文件夹中,但它们仍然没有显示。

包的版本是

jupyterlab==3.2.6

jupyterlab-templates==0.3.1

【问题讨论】:

  • 奇怪的错误,你能在你的配置文件中试试这个吗? c.JupyterLabTemplates.template_dirs = ['/Users/emilaz/.jupyter']。这是因为在文档中它说“您必须将模板放在子目录中”。

标签: python jupyter jupyter-lab jupyter-extensions


【解决方案1】:

肮脏的解决方案:将 os 链接添加到您的 template_dir 中它看到 Sample.ipynb 的文件夹附近

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-09-23
    • 1970-01-01
    • 2021-01-04
    • 2021-06-25
    • 2019-06-04
    • 1970-01-01
    • 2017-08-30
    • 2021-04-05
    相关资源
    最近更新 更多