【发布时间】: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
我试过了
- 取消并重新安装
jupyterlab和jupyterlab_templates - 将模板文件的权限更改为 660
- 在这两个文件上运行
jupyter trust。 - 将文件移动到别处(在非隐藏文件夹中)
然后我尝试包含默认模板(设置c.JupyterLabTemplates.include_default=True、c.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