Jupyter Notebook出现无关代码建议自动填充问题求助
解决Jupyter Notebook无关代码自动填充问题
禁用冗余代码补全插件
Jupyter的自动补全通常由jupyterlab-lsp或jupyter-contrib-nbextensions这类插件提供,若出现无关建议,可通过命令卸载相关组件:# 使用conda卸载 conda remove jupyterlab-lsp jupyter-contrib-nbextensions # 若用pip安装则执行 pip uninstall jupyterlab-lsp jupyter-contrib-nbextensions -y清除补全缓存文件
找到Jupyter的配置目录:Windows为C:\Users\[你的用户名]\.jupyter\,macOS/Linux为~/.jupyter/,删除其中的lsp_cache文件夹及nbextensions相关缓存目录,之后重启Jupyter。重置Jupyter配置至默认
执行命令覆盖现有配置,清除所有自定义补全设置:jupyter notebook --generate-config --overwrite切换至Jupyter Lab(备选方案)
若Notebook的问题持续,可尝试使用Jupyter Lab,其补全系统更稳定,安装命令:conda install jupyterlab -y安装完成后用
jupyter lab命令启动即可。
内容的提问来源于stack exchange,提问作者John Joseph Z
相关产品推荐
相关产品推荐

