启动 Jupyter Lab 时出现语言服务器规范查找器错误
Language Server Spec Finder Errors When Launching Jupyter Lab
我只想了解下面发生的事情。我正在使用 MacOs,最近从 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
问题是因为 jupyter 服务器无法找到语言服务器。就我而言,jupyter 是使用 /opt/miniconda3/ 下的 conda 环境(miniconda)安装和维护的,而我的 nodejs 位于 /usr/local/ 下。理想情况下,如果您已经在使用 conda 管理器,您将希望完全卸载 nodejs 并使用 conda 重新安装它。否则,删除整个 anaconda/conda,然后使用 pip 或 brew 重新安装 python(https://www.python.org/downloads/release/python-381/)和 jupyter,具体取决于 how/where 您安装了 nodejs。
我能够按照以下步骤解决我的问题:
1.) 彻底卸载node js。我可以通过 运行ning 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。
现在这是我所拥有的能够解决我的问题的最佳答案。
我只想了解下面发生的事情。我正在使用 MacOs,最近从 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
问题是因为 jupyter 服务器无法找到语言服务器。就我而言,jupyter 是使用 /opt/miniconda3/ 下的 conda 环境(miniconda)安装和维护的,而我的 nodejs 位于 /usr/local/ 下。理想情况下,如果您已经在使用 conda 管理器,您将希望完全卸载 nodejs 并使用 conda 重新安装它。否则,删除整个 anaconda/conda,然后使用 pip 或 brew 重新安装 python(https://www.python.org/downloads/release/python-381/)和 jupyter,具体取决于 how/where 您安装了 nodejs。
我能够按照以下步骤解决我的问题:
1.) 彻底卸载node js。我可以通过 运行ning 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。
现在这是我所拥有的能够解决我的问题的最佳答案。