新环境安装
pip install jupyterlab==3.6.3
pip install nodejs
pip install jupyterlab-lsp==3.10.2
pip install python-lsp-server[all]
pip install jupyterlab-unfold==0.2.2
pip install jupyterlab-language-pack-zh-CN==3.5.post4
1. jupyterlab 安装与卸载
conda install -c conda-forge jupyterlab
pip install jupyterlab
pip uninstall -y jupyterlab
pip uninstall -y jupyterlab-pygments
pip uninstall -y jupyter-console
pip uninstall -y jupyterlab-server
pip uninstall -y jupyterlab-widgets
2. jupyter默认更改
- 启动目录修改
# notebook
jupyter notebook --generate-config
c.NotebookApp.notebook_dir = "F:\BaiduNetdiskWorkspace\CodeStudy\JupyterLab"
# lab
jupyter lab--generate-config
c.ServerApp.root_dir = "F:\BaiduNetdiskWorkspace\CodeStudy\JupyterLab"
- 浏览器修改
# 改为chrome
import webbrowser
webbrowser.register('chrome', None, webbrowser.GenericBrowser
(u'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe'))
c.NotebookApp.browser = 'chrome'
# 改为Edge
import webbrowser
webbrowser.register("Microsoft Edge",None,webbrowser.GenericBrowser
(u"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe"))
c.ServerApp.browser = 'Microsoft Edge'
3. 插件安装
3.1 jupyter-lsp安装
- 安装
pip install nodejs
pip install jupyterlab-lsp
pip install python-lsp-server[all]
- 在网页的侧边栏的插件管理器中搜索lsp,找到名称为【@krassowski/jupyterlab-lsp】的插件,点击安装。
3.2 jupyterlab-unfold
代码折叠
3.2 jupyterlab_code_formatter
# 安装插件
pip install jupyterlab_code_formatter
# 安装格式化工具
pip install black isort
3.3 jupyterlab 汉化包
pip install jupyterlab-language-pack-zh-CN
4. 其他
conda clean -p //删除没有用的包
conda clean -t //删除tar包
conda clean -y --all //删除所有的安装包及cache