Jupyter 实验室片段似乎是只读的

问题描述 投票:0回答:1

我在 Jupyter lab 4.1.6 上使用 python 3.12.2。 我使用 pip 激活了 Jupyter 实验室片段,如文档中所述:

pip install jupyterlab-code-snippets
jupyter lab clean
jupyter lab build

出现 部分。我可以展示“新代码片段”工具。到现在为止一切都很好。

第一个问题:[代码]字段呈灰色。无法添加代码。
第二个问题:当我点击[创建并关闭]按钮时没有任何反应。片段列表仍为空。

我尝试了添加新截图的不同方法(拖放代码单元格、选择代码并右键单击等)。代码片段部分似乎是只读的,因为我无法创建任何代码片段。

我需要提到的一件奇怪的事情: 在扩展管理器中,我看到一个选项“更新到 2.2.1”(请参见左侧的屏幕截图)。 奇怪的是,pip 告诉我 2.2.1 版本的设置成功(见下面的日志)。

有人遇到过这种奇怪的行为吗? 我在文档中找不到任何提示。

安装日志下方:

pip install jupyterlab-code-snippets
Collecting jupyterlab-code-snippets
Using cached jupyterlab_code_snippets-2.2.1-py3-none-any.whl.metadata (19 kB)
Using cached jupyterlab_code_snippets-2.2.1-py3-none-any.whl (163 kB)
Installing collected packages: jupyterlab-code-snippets
Successfully installed jupyterlab-code-snippets-2.2.1

jupyter lab clean
[LabCleanApp] Cleaning C:\Users\JCF\AppData\Local\Programs\Python\Python312\share\jupyter\lab...
[LabCleanApp] Removing staging...
[LabCleanApp] Success!

jupyter lab build
[LabBuildApp] JupyterLab 4.1.6
[LabBuildApp] Building in C:\Users\JCF\AppData\Local\Programs\Python\Python312\share\jupyter\lab
[LabBuildApp] Building jupyterlab assets (production, minimized)
-

jupyter-lab jupyter-extensions
1个回答
0
投票

韦恩提到的帖子效果非常好。

我将简单地添加一些对我们中的一些人(包括我自己)来说可能并不重要的细节:

在 Windows 计算机上,包含设置的文件位于文件夹中: [驱动器]:\Users[您的用户].jupyter\lab\user-settings\jupyterlab-code-snippets

我在 Notepad++ 中打开了此文件夹中包含的唯一文件“snippets.jupyterlab-settings”,并用链接中提供的代码替换了该文件的完整内容。

然后我重新打开 Jupyter,文档中提到的所有功能 (https://jupyterlab-code-snippets-documentation.readthedocs.io/en/latest/user/features.html) 突然像魔术一样工作。

非常感谢韦恩的提示。我将这篇文章保留在我的笔记中,以防在未来版本中未修复。

© www.soinside.com 2019 - 2024. All rights reserved.