ModuleNotFoundError: 处没有实验室扩展名。当在终端中执行“jupyter labextensiondevelopment.--overwrite”时

问题描述 投票:0回答:2
  1. 问题总结。

我正在开发 jupyterlab 的扩展。 该扩展具有前端部分和服务器(python)部分。 但是,在我根据教程和 readMe.md 安装扩展后。 jupyterlab 无法加载服务器。我尝试再次运行命令,遇到问题: ModuleNotFoundError: 处没有实验室扩展名。 执行时 终端中的“jupyter labextensiondevelopment.--overwrite”。

教程: https://jupyterlab.readthedocs.io/en/stable/extension/extension_tutorial.html#extension-tutorial README.md 喜欢:

# Clone the repo to your local environment
# Change directory to the athena_jupyter directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Server extension must be manually installed in develop mode
jupyter server extension enable athena_jupyter
# Rebuild extension Typescript source after making changes
jlpm run build
  1. 我已经尝试过了。

2.1 多次阅读readme.txt。

2.2 创建新的conda环境,初始项目工作了。然而,当我添加一些东西,重建时,它又失败了。

2.3 删除有关 jupyterlab 扩展配置的内容。因为它有其他警告日志:找不到我的扩展。

2.4 事实上,我在服务器上就遇到过这个问题。我尝试了很多方法都解决了,但我不知道问题出在哪里,也无法得到这个问题的总结解决方案,这次我无法解决它。

提前致谢!

jupyter-lab
2个回答
0
投票

可以通过从扩展程序的

_jupyter_labextension_paths
中删除
__init__.py
来重现此错误。

例如,类似的内容应该位于

__init__.py
文件中。

def _jupyter_labextension_paths():
    return [{
        "src": "labextension",
        "dest": data["name"]
    }]

也许较新版本的 cookiecutter 生成的项目不依赖于

_jupyter_labextension_paths
__init__.py
的存在:https://github.com/jupyterlab/jupyterlab-module-federation/issues/61


0
投票

您可能必须从 IPython 导入 get_ipython,就像这样......

from IPython import get_ipython

然后像这样使用它......

ipy = get_ipython()
© www.soinside.com 2019 - 2024. All rights reserved.