gpt4 book ai didi

python - 如何摆脱 Python Jupyter notebook 错误 : 404 GET/nbextensions/nbextensions_configurator/tree_tab/main. js

转载 作者:行者123 更新时间:2023-12-03 14:30:21 30 4
gpt4 key购买 nike

Sys: Macbook 2012
Python: Python 3.5.1 :: Continuum Analytics, Inc.
Anaconda: conda 4.2.13



我在 Jupyter 笔记本中使用笔记本扩展 (nbextensions) 时遇到问题,不知道如何解决该问题。尽管多次安装和重新安装(使用 pip 和/或 conda)并完全删除和重新安装 anaconda,但我最终还是想使用未显示在我的 Jupyter Notebook 工具栏上的 nbextensions。确切的症状,带有链接的日志如下。

我的错误信息:404 GET/nbextensions/nbextensions_configurator/tree_tab/main.js

目标 : 我只想再次使用笔记本扩展:-(

症状总结
  • 我不能使用笔记本扩展。按钮没有显示在我的
    nbpresent 页面以及当我尝试使用 conda packages
    扩展,我收到一个错误。 (以下屏幕截图)
  • 我有多个 nbextension 文件夹;不知道我是否应该删除
    某事(下面的屏幕截图)
  • 我试图完全删除我的 anaconda安装并重新安装;
    没有工作尝试 pip 卸载 jupyter 和 conda 删除
    jupyter 但没有改变这个问题
  • jupyter_path有几个不同的路径作为输出。我不知道
    如果这是一个问题,但也许是。不知道删什么

  • 以下是详细信息和屏幕截图;任何帮助表示赞赏

    我把我的 log file from launching jupyter notebook with debug here

    这是我的 jupyter_path 输出:

    >>> from jupyter_core.paths import jupyter_path
    >>> print(jupyter_path())
    ['/Users/linwood/Library/Jupyter', '/Users/linwood/anaconda3/share/jupyter', '/usr/local/share/jupyter', '/usr/share/jupyter']

    如果这有帮助,这是我不在环境中时使用的 jupyter:

    $ which jupyter
    /Users/linwood/anaconda3/bin/jupyter

    现在的屏幕截图:

    多个 nbextension 文件夹
    multiple nbextensions

    conda 包错误
    conda packages error

    Jupyter_path 打印输出
    jupyter path

    编辑

    根据要求,javascript 控制台日志。如果这是错误的,我深表歉意,但我使用 Chrome 浏览器的“开发人员工具”控制台记录页面重新加载时的 javascript 事件。这是信息(下面的错误图片):
    2. Network(X) Basics (Student).ipynb:119 loaded custom.js
    default.js:48 Default extension for cell metadata editing loaded.
    rawcell.js:82 Raw Cell Format toolbar preset loaded.
    slideshow.js:43 Slideshow extension for metadata editing loaded.
    menubar.js:240 actions jupyter-notebook:find-and-replace does not exist, still binding it in case it will be defined later...
    MenuBar.bind_events @ menubar.js:240
    MenuBar @ menubar.js:55
    (anonymous) @ main.js:102
    execCb @ require.js?v=6da8be3…:1690
    check @ require.js?v=6da8be3…:865
    (anonymous) @ require.js?v=6da8be3…:1140
    (anonymous) @ require.js?v=6da8be3…:131
    (anonymous) @ require.js?v=6da8be3…:1190
    each @ require.js?v=6da8be3…:56
    emit @ require.js?v=6da8be3…:1189
    check @ require.js?v=6da8be3…:940
    (anonymous) @ require.js?v=6da8be3…:1140
    (anonymous) @ require.js?v=6da8be3…:131
    (anonymous) @ require.js?v=6da8be3…:1190
    each @ require.js?v=6da8be3…:56
    emit @ require.js?v=6da8be3…:1189
    check @ require.js?v=6da8be3…:940
    enable @ require.js?v=6da8be3…:1177
    init @ require.js?v=6da8be3…:783
    callGetModule @ require.js?v=6da8be3…:1204
    completeLoad @ require.js?v=6da8be3…:1604
    onScriptLoad @ require.js?v=6da8be3…:1711
    utils.js:59 load_extensions ["nbpresent/js/nbpresent.min", "nb_conda/main", "nb_anacondacloud/main", "jupyter-js-widgets/extension"]
    utils.js:36 Loading extension: nbpresent/js/nbpresent.min
    utils.js:36 Loading extension: nb_anacondacloud/main
    require.js?v=6da8be3…:1952 GET http://localhost:8888/nbextensions/nbpresent/js/nbpresent.deps.min.js.js
    req.load @ require.js?v=6da8be3…:1952
    load @ require.js?v=6da8be3…:1679
    load @ require.js?v=6da8be3…:829
    fetch @ require.js?v=6da8be3…:819
    check @ require.js?v=6da8be3…:851
    enable @ require.js?v=6da8be3…:1177
    enable @ require.js?v=6da8be3…:1550
    (anonymous) @ require.js?v=6da8be3…:1162
    (anonymous) @ require.js?v=6da8be3…:131
    each @ require.js?v=6da8be3…:56
    enable @ require.js?v=6da8be3…:1114
    init @ require.js?v=6da8be3…:783
    (anonymous) @ require.js?v=6da8be3…:1453
    require.js?v=6da8be3…:165 Uncaught Error: Script error for "nbpresent-deps"
    http://requirejs.org/docs/errors.html#scripterror
    at makeError (require.js?v=6da8be3…:165)
    at HTMLScriptElement.onScriptError (require.js?v=6da8be3…:1732)
    makeError @ require.js?v=6da8be3…:165
    onScriptError @ require.js?v=6da8be3…:1732
    session.js:54 Session: kernel_created (ac540fe3-f39d-4a3d-80c5-265638fb8811)
    kernel.js:453 Starting WebSockets: ws://localhost:8888/api/kernels/445b6828-66f3-4312-a79f-3c4473345579
    kernel.js:100 Kernel: kernel_connected (445b6828-66f3-4312-a79f-3c4473345579)
    kernel.js:100 Kernel: kernel_ready (445b6828-66f3-4312-a79f-3c4473345579)
    utils.js:36 Loading extension: nb_conda/main
    utils.js:36 Loading extension: jupyter-js-widgets/extension
    extension.js:88 loaded widgets
    manager-base.js:195 Widget backend and frontend versions are compatible

    enter image description here

    最佳答案

    安装 nbextensions
    解决方案 a) 创建新的 env,激活,安装 nbextensions,安装 js/css 文件,启动 jupyter

    conda create --name py39 python=3.9
    conda activae py39
    conda install -c conda-forge jupyter_contrib_nbextensions
    jupyter contrib nbextension install --user
    jupyter-notebook
    enter image description here
    解决方案 b) https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1012#issuecomment-309448477
    事实上,如果你只想摆脱 404 Get 错误
    jupyter nbextension list
    你会看到输出
        Known nbextensions:
    config dir: /home/your_user/.jupyter/nbconfig
    notebook section
    nbextensions_configurator/config_menu/main disabled
    contrib_nbextensions_help_item/main disabled
    hinterland/hinterland disabled
    code_prettify/code_prettify disabled
    jupyter-js-widgets/extension disabled
    tree section
    nbextensions_configurator/tree_tab/main enabled
    - Validating: problems found:
    - require? X nbextensions_configurator/tree_tab/main
    转到文件中的每个主要配置并将其更改为 false。我在 中找到了所有文件~/anaconda3/etc/jupyter/nbconfig
    具体 tree.json 就我而言
    nano tree.json
    输出
    {
    "load_extensions": {
    "nbextensions_configurator/tree_tab/main": true
    }
    }
    将 true 改为 后假 你会摆脱404

    关于python - 如何摆脱 Python Jupyter notebook 错误 : 404 GET/nbextensions/nbextensions_configurator/tree_tab/main. js,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41627159/

    30 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com