Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何使用ContentsManager for Jupyter?_Python_Python 3.x_Jupyter Notebook_Jupyter_Jupyter Lab - Fatal编程技术网

Python 如何使用ContentsManager for Jupyter?

Python 如何使用ContentsManager for Jupyter?,python,python-3.x,jupyter-notebook,jupyter,jupyter-lab,Python,Python 3.x,Jupyter Notebook,Jupyter,Jupyter Lab,我读过Jupyter ContentsManager,但不知道如何使用它,而且文档非常糟糕。我该怎么办?我在哪里运行它以及如何将它连接到我的Jupyter环境和笔记本电脑?要交换新Jupyter服务器上运行的JupyterLab 3.0+中的内容管理器(这是默认的操作方式,但如果您在JupyterHub上运行,它可能仍然使用旧的笔记本服务器),创建一个jupyter\u server\u config.py文件;您可以使用以下命令在适当的位置自动生成: jupyter server --gene

我读过Jupyter ContentsManager,但不知道如何使用它,而且文档非常糟糕。我该怎么办?我在哪里运行它以及如何将它连接到我的Jupyter环境和笔记本电脑?

要交换新Jupyter服务器上运行的JupyterLab 3.0+中的内容管理器(这是默认的操作方式,但如果您在JupyterHub上运行,它可能仍然使用旧的笔记本服务器),创建一个
jupyter\u server\u config.py
文件;您可以使用以下命令在适当的位置自动生成:

jupyter server --generate-config
并将内容管理器类设置为您自己的管理器:

c.ServerApp.contents_manager_class = "python.module.for.your.ContentsManagerSubclass"
jupyter服务器列表中描述了此选项

(或者,您可以使用json文件)。对于较旧的JupyterLab版本,或者如果出于某种奇怪的原因您正在使用旧笔记本,您将希望使用
jupyter\u notebook\u config.py
,该选项的名称为
c.NotebookApp.contents\u manager\u class
。您可以阅读更多关于此主题的内容-尽管示例引用了旧的笔记本操作方式,因此您需要相应地更新


您可能还想了解如何对用户设置做出反应,请参阅代码。

您想用ContentsManager实现什么?文档是。@krassowski首先:我如何告诉jupyter使用我自己的ContentsManager?请参阅下面的答案。不过,您可能不需要自定义ContentsManager。谢谢您提供的所有信息。运行jupyter时是否需要执行任何额外的步骤,以便使用自定义配置而不是默认配置?否。请注意,配置需要位于jupyter识别的标准位置。如果您通过上面的命令生成它,它将已经存在;否则,请参见
jupyter--path
和。