天天看点

linux上如何给jupyterlab安装jupyterlab-lsp插件

jupyterlab-lsp是jupyterlab的自动代码补全插件,其实你也可以选择kite,但是我的服务器系统是centos,而kite不支持该系统,所以我只能选择lsp(老色痞)了。

我找了网上贼多的教程,只是告诉我在jupyterlab的插件里找到jupyterlab-lsp之后点击install就完事了,结果啥反应没有。。。

linux上如何给jupyterlab安装jupyterlab-lsp插件
下面介绍如何安装并启动该插件。

  1. 假设你已经安装了jupyterlab了,那么第一步是安装server extension
pip install --pre jupyter-lsp      
  1. 之后安装frontend extension
jupyter labextension install @krassowski/jupyterlab-lsp      
  1. 给指定变成语言安装LSP server
pip install python-language-server[python]      

最后启动jupyterlab并新建一个ipynb文件

jupyter-lab --port 6666      

如果左下角显示这个说明你安装且运行成功了

继续阅读