启动Jupyter Lab时的Language Server Spec Finder错误

时间:2019-12-18 06:58:03

标签: jupyter-notebook jupyter jupyter-lab

我只想了解下面发生的事情。我正在使用MacO,最近从bash切换到zsh。然后我安装了jupyterlab-lsp。你能开导我吗?


    [W 14:27:11.102 LabApp] Failed to fetch commands from language server spec finder`bash-language-server`:
        expected str, bytes or os.PathLike object, not tuple
    [W 14:27:11.108 LabApp] Failed to fetch commands from language server spec finder`dockerfile-language-server-nodejs`:
        expected str, bytes or os.PathLike object, not tuple
    [W 14:27:11.113 LabApp] Failed to fetch commands from language server spec finder`javascript-typescript-langserver`:
        expected str, bytes or os.PathLike object, not tuple
    [W 14:27:11.125 LabApp] Failed to fetch commands from language server spec finder`unified-language-server`:
        expected str, bytes or os.PathLike object, not tuple
    [W 14:27:11.129 LabApp] Failed to fetch commands from language server spec finder`vscode-css-languageserver-bin`:
        expected str, bytes or os.PathLike object, not tuple
    [W 14:27:11.133 LabApp] Failed to fetch commands from language server spec finder`vscode-html-languageserver-bin`:
        expected str, bytes or os.PathLike object, not tuple
    [W 14:27:11.138 LabApp] Failed to fetch commands from language server spec finder`vscode-json-languageserver-bin`:
        expected str, bytes or os.PathLike object, not tuple
    [W 14:27:11.142 LabApp] Failed to fetch commands from language server spec finder`yaml-language-server`:
        expected str, bytes or os.PathLike object, not tuple
    [I 14:27:11.193 LabApp] JupyterLab extension loaded from /Users/emilolbinado/anaconda3/lib/python3.6/site-packages/jupyterlab
    [I 14:27:11.193 LabApp] JupyterLab application directory is /Users/emilolbinado/anaconda3/share/jupyter/lab
    [I 14:27:11.195 LabApp] Serving notebooks from local directory: /Users/emilolbinado
    [I 14:27:11.195 LabApp] The Jupyter Notebook is running at:
    [I 14:27:11.195 LabApp] http://localhost:8888/?token=95a48a55a6638a48cbfa24c95106903144ffaafe10a65652
    [I 14:27:11.195 LabApp]  or http://127.0.0.1:8888/?token=95a48a55a6638a48cbfa24c95106903144ffaafe10a65652
    [I 14:27:11.195 LabApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
    [C 14:27:11.202 LabApp] 

        To access the notebook, open this file in a browser:
            file:///Users/emilolbinado/Library/Jupyter/runtime/nbserver-8098-open.html
        Or copy and paste one of these URLs:
            http://localhost:8888/?token=95a48a55a6638a48cbfa24c95106903144ffaafe10a65652
         or http://127.0.0.1:8888/?token=95a48a55a6638a48cbfa24c95106903144ffaafe10a65652
    Opening in existing browser session.
    [I 14:27:14.645 LabApp] Build is up to date
    [I 14:27:21.183 LabApp] Kernel started: 5c355536-12b0-41de-8c81-cc2afef6a85c
    [I 14:27:21.218 LabApp] Kernel started: 9505d56b-0f5a-43f4-970e-990fa0852522

1 个答案:

答案 0 :(得分:2)

问题是因为jupyter服务器无法找到语言服务器。在我的案例中,jupyter是使用/ opt / miniconda3 /下的conda环境(miniconda)安装和维护的,而我的nodejs位于/ usr / local /下。理想情况下,如果您已经在使用conda管理器,则将要完全卸载nodejs并使用conda重新安装它。否则,请删除整个anaconda / conda,然后根据安装nodejs的方式/位置,使用pip或brew重新安装python(https://www.python.org/downloads/release/python-381/)和jupyter。

我可以按照以下步骤解决问题:

1。)完全卸载节点js。我可以通过运行nvm uninstall <version>来做到这一点,或者如果您正在使用自制软件,请先运行brew uninstall node然后在终端上运行rm -f /usr/local/bin/npm。此外,您可以遵循以下参考:How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)

2。)重新安装nodejs。 conda install -c conda-forge nodejs

3。)安装语言服务器。请参见参考:https://github.com/krassowski/jupyterlab-lsp/blob/master/LANGUAGESERVERS.md#installing-language-servers

4。)重新启动终端并运行jupyter lab。

现在,这是我能够解决我的问题的最佳答案。