JupyterLab4.5安装使用

简介

本文介绍了:

  • Python绿色版构建
  • FreeThreaded安装
  • Node.js配置
  • JupyterLab环境搭建的全过程。
  • JupyterLab可用的常用插件

首先通过备份和脚本配置实现Python便携化;

然后解决FreeThreaded安装失败问题,提供命令行安装方案;

接着配置Node.js环境并设置国内镜像源;

最后创建虚拟环境安装JupyterLab并完成汉化。

文中详细列出了各步骤的命令行操作、下载地址和常见问题解决方法,

为开发者提供了一套完整的Python科学计算环境配置指南。

一、python安装(构建绿色版):

  1. 下载地址:

  2. 安装到 \apply\Python3142

  3. 拷贝\apply\Python3142 到\apply\Python3142_bak

  4. 卸载python3.14.2

  5. 拷贝\apply\Python3142_bak 到\apply\Python3142

  6. 添加环境变量:\apply\Python3142\Scripts和\apply\Python3142 到PATH

  7. 在\apply\Python3142 添加两个文件python3.14.2.bat 和 python3142.bat,内容如下:

    commandline 复制代码
    @echo off
    echo 原始命令:%~f0 %*
    echo 运行命令:%~d0%~p0python.exe %*
    %~d0%~p0python.exe %*
  8. 在\apply\Python3142 添加两个文件python3.14.2.shpython3142.sh,内容如下:

    bash 复制代码
    base_dir=$(cd $(dirname $0);pwd)
    echo 原始命令:$0 $*
    echo 运行命令:${base_dir}/python.exe $*
    ${base_dir}/python.exe $*
  9. 在\apply\Python3142\Scripts添加两个文件pip3.14.2.bat 和 pip3142.bat,内容如下:

    commandline 复制代码
    @echo off
    echo 原始命令:%~f0 %*
    echo 运行命令:%~d0%~p0pip.exe %*
    %~d0%~p0pip.exe %*
  10. 在\apply\Python3142\Scripts添加两个文件 pip3.14.2.shpip3142.sh,内容如下:

    bash 复制代码
    base_dir=$(cd $(dirname $0);pwd)
    echo 原始命令:$0 $*
    echo 运行命令:${base_dir}/pip.exe $*
    ${base_dir}/pip.exe $*
  11. 测试:

    • 在cmd窗口中

      commandline 复制代码
      python3.14.2 --version
      pip3142 --version
    • 在gitbash窗口中

      shell 复制代码
      python3.14.2.sh --version
      pip3142.sh --version

二、安装freethreaded:

  1. 使用安装程序直接安装:

    勾选需要现在的软件,如下图:

    在这里插入图片描述

    十分遗憾,在国内会报错,表示安装失败,日志中告诉你下载core_pdb.msi或freethreaded.msi 失败

  2. 手工下载安装:

    从下面网站直接下载,注意相应的版本号,例如3.14.2,对应的是:

    https://mirrors.ustc.edu.cn/python/3.14.2/amd64/

    https://www.python.org/ftp/python/3.14.2/

    https://www.python.org/ftp/python/3.14.2/amd64/freethreaded.msi

    遗憾的是直接点击安装,依然报错:

    "The TARGETDIR variable must be provided when invoking this installer"

  3. 命令行安装

    使用命令行安装,指定TARGETDIR,例如我的python安装目录是"D:\apply\Python3142",所以命令是:

    freethreaded3.14.2.msi TARGETDIR="D:\apply\Python3142"

    在这里插入图片描述

  4. 总结:

    安装python时,在"Advanced Options"中,含有"Download"开头的几个选项一定不要选。

    手工现在msi,从 https://www.python.org/ftp/python/3.14.2/amd64/中现在3.14.2的freethreaded.msi

    打开命令行窗口,执行命令行命令,指定你的python安装名目录,我的是"D:\Python3142",所以命令是:

    freethreaded3.14.2.msi TARGETDIR="D:\apply\Python3142"

三、安装nodejs

  1. 安装node:

    • 官网: https://nodejs.org/zh-cn/download
    • 版本:v20.19.6 (LTS)
    • 下载独立文件.zip
    • 放到d:\apply目录下
    • 解压到此目录
    • 设置环境变量: PATH包含:D:\apply\node-v20.19.6-win-x64
  2. 验证:

    shell 复制代码
    node -v # Should print "v18.20.8".
    # 验证 npm 版本:
    npm -v # Should print "10.8.2".
  3. 设置

    shell 复制代码
    npm config set registry https://repo.huaweicloud.com/repository/npm/
    mkdir D:\apply\node_repo
    mkdir D:\apply\node_repo\node_global
    mkdir D:\apply\node_repo\node_cache
    npm config set prefix "D:\apply\node_repo\node_global"
    npm config set cache "D:\apply\node_repo\node_cache"
    D:\apply\node-v18.17.1-win-x64\npm install -g ijavascript

    进入环境变量对话框,在【系统变量】下新建【NODE_PATH】,
    输入【D:\apply\node_repo\node_global\node_modules】,
    将【用户变量】下的【Path】修改为【D:\apply\node_repo\node_global】

四、安装jupyter

  1. 创建虚拟环境

    • cmd窗口

      commandline 复制代码
      mkdir .\my_jupyterlab4.5
      cd .\my_jupyterlab4.5
      
      python3.14.2 -m venv jupyter_venv
      .\jupyter_venv\Scripts\activate
      pip install requests
      deactivate
    • Git Bash窗口

      shell 复制代码
      mkdir ./my_jupyterlab4.5
      cd ./my_jupyterlab4.5
      python3.13.3.sh -m venv jupyter_venv
      
      source ./jupyter_venv/Scripts/activate
      pip install requests
      deactivate
  2. 安装jupyterlab

  3. 汉化:

四、插件:

  1. 可用插件相关网址:

  2. 安装插件:

    • 可以直接安装的插件
    shell 复制代码
    pip install --upgrade pip setuptools wheel
    pip install jupyterlab-lsp
    pip install python-lsp-server
    pip install "python-lsp-server[all]"
    pip install jupyterlab-code-formatter
    pip install black isort
    pip install jupyterlab-git
    
    pip install ipywidgets
    jupyter labextension enable @jupyter-widgets/jupyterlab-manager
    pip install qgrid
    # 安装MikTeX https://miktex.org/
    pip install jupyterlab-theme-solarized-dark
    pip install jupyterlab-solarized-light-theme
    pip install jupyter-launcher-shortcuts
     
    pip install ipympl
    pip install matplotlib
          
    pip install jupyterlab-spreadsheet-editor
    pip install jupyterlab-spreadsheet
    pip install jupyterlab_iframe
    pip install jupyterlab_execute_time
    pip install bash_kernel
    pip install jupyterlab_myst
    pip install jupyterlab-latex
    
    npm install sql-language-server 
    pip install jupyterlab_sql_editor[all]
    pip install bqplot
    
    pip install json-lsp
    pip install yaml-lsp
    pip install sshkernel
    
    # pip install metakernel==0.25.*
    # pip install metakernel==0.30.3
    
    # 安装matplotlib 插件
    pip install ipympl
    pip install npm
    pip install nodejs
    jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter-matplotlib
    
    # 安装lsp插件
    pip install jupyter-lsp
    pip install python-lsp-server[all]
    pip install --upgrade pyflakes flake8 pyright
    pip install --upgrade basedpyright
    pip install --upgrade jedi-language-server
    
    npm install -g bash-language-server
    npm install -g dockerfile-language-server-nodejs
    npm install -g javascript-typescript-langserver
    npm install -g typescript-language-server typescript
    npm install -g vscode-css-languageserver-bin
    npm install -g javascript-typescript-langserver
    npm install -g vscode-html-languageserver-bin
    npm install -g vscode-json-languageserver-bin
    npm install -g yaml-language-server
    npm install -g unified-language-server
    
    # 安装code formatter 插件
    pip install jupyterlab_code_formatter
    pip install black isort
    
    pip install jupyterlab_latex
    pip install jupyterlab-dash
    
    # 该插件可以在Lab中展示plotly可视化效果。
    pip install jupyterlab-fasta
    pip install jupyterlab-geojson
    pip install jupyterlab-katex
    
    
    # 该插件可以在Lab中展示bokeh可视化效果。
    pip install jupyter_bokeh
    
    # jupyter lab clean
    # jupyter-lab build --log-level=10
    # jupyter labextension list && start_lab.cmd
    • pypi最新的jupyterlab插件
    shell 复制代码
    pip install jupyterlab-sql-editor
    pip install jupyterlab-git
    pip install jupyterlab-materialdarker
    pip install jupyterlab-show-commands-reference-extension
    pip install jupyterlab-markdown-switch-tab-scrolling-fix
    pip install jupyterlab-export-markdown-extension
    pip install stellars-jupyterlab-darcula-theme
    pip install stellars-jupyterlab-sublime-theme
    pip install jupyterlab-vscode-icons-extension
    pip install jupyterlab_highlight_selected_word
    pip install jupyterlab-solarized-light-theme
    pip install jupyterlab-execute-time
    pip install jupyterlab-classiq
    pip install jupyterlab-markdown-insert-content-extension
    pip install jupyterlab-drawio-render-extension
    pip install jupyterlab-mmd-to-png-extension
    pip install jupyterlab-latex
    pip install jupyterlab-favorites
    pip install jupyterlab-js
    pip install jupyterlab-myst
    
    pip install jupyterlab-doc-reader-extension
    pip install qsharp-jupyterlab
    pip install jupyterlab-orm-test
    
    pip install jupyterlab_h5web[full]
    pip install jupyterlab-colourful-tab-extension
    pip install jupyterlab-ai-commands
    
    pip install jupyterlab-block-copy
    pip install jupyterlab-makefile-file-type-extension
    pip install jupyterlab-zip-extension
    pip install jupyterlab-todo-list
    pip install jupyterlab-nbconvert-nocode
    pip install jupyterlab-markdown-viewer-toc-fix
    pip install jupyterlab-close-all-tabs-extension
    pip install jupyterlab-filesystem-access
    pip install jupyterlab-quick-share
    pip install jupyterlab-templates
    pip install jupyterlab-cell-lock
    pip install jupyterlab-quickopen
    pip install jupyterlab-slideshow
    pip install jupyterlab-autodocstring
    pip install jupyterlab-code-formatter
    pip install jupyterlab-xssguard
    pip install jupyterlab-language-pack-zh-CN
    
    # pip install stellars_jupyterlab_extensions
    # pip install jupyterlab-refresh-view-extension
    # pip uninstall jupyterlab-fold-all-code-extension
    # pip uninstall jupyterlab-github-markdown-alerts-extension
    # pip install sagemaker-jupyterlab-extension-common
    # pip install stellars-jupyterlab-favourites
    # pip install atoti-jupyterlab
    # pip uninstall jupyterlab-ghostty
    # pip install jupyterlab-judge
    # pip install jupyterlab-server
    # pip uninstall jupyterlab-chat
    # pip uninstall jupyter-collaboration-ui
    # pip uninstall jupyter-collaboration
    # pip install jupyter-scheduler
    
    jupyter labextension list
  3. 插件管理

    复制代码
    注意:如果没有出现插件选项卡,可以通过 
    setting-->Advanced Settings Editor--Extension Manager :
    在User Overrides 添加语句{"enabled": true},最后保存,就可以出现插件选项
    当然,你也可以使用命令行方式进行插件的查看、安装、更新和删除
    
    查看已安装插件:jupyter labextension list
    更新已安装插件:jupyter labextension update --all
    安装插件toc:jupyter labextension install @jupyterlab/toc
    删除插件toc:jupyter labextension uninstall @jupyterlab/toc
  4. 手工安装插件

    shell 复制代码
    # 1. 安装扩展管理依赖(如果没装过)
    pip install jupyterlab_server
    
    jupyter labextension list
    
    # 2. 安装本地扩展包
    jupyter labextension install jupyterlab-htmlviewer-4.5.1.tgz
    
    # 3. 重建 JupyterLab(确保扩展生效)
    jupyter lab build
    
    # 4. 启动 JupyterLab
    jupyter lab
    • 安装列表
    shell 复制代码
    # 5. 命令如下:
    cd E:\my_jupyterlab4.5\jupyter_plus
    jupyter labextension install jupyterlab-application-4.5.1.tgz
    jupyter labextension install jupyterlab-application-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-apputils-4.6.1.tgz
    jupyter labextension install jupyterlab-apputils-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-attachments-4.5.1.tgz
    jupyter labextension install jupyterlab-audio-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-builder-4.5.1.tgz
    jupyter labextension install jupyterlab-buildutils-4.5.1.tgz
    jupyter labextension install jupyterlab-cells-4.5.1.tgz
    jupyter labextension install jupyterlab-celltags-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-cell-toolbar-4.5.1.tgz
    jupyter labextension install jupyterlab-cell-toolbar-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-codeeditor-4.5.1.tgz
    jupyter labextension install jupyterlab-codemirror-4.5.1.tgz
    jupyter labextension install jupyterlab-codemirror-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-completer-4.5.1.tgz
    jupyter labextension install jupyterlab-completer-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-console-4.5.1.tgz
    jupyter labextension install jupyterlab-console-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-coreutils-6.5.1.tgz
    jupyter labextension install jupyterlab-csvviewer-4.5.1.tgz
    jupyter labextension install jupyterlab-csvviewer-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-debugger-4.5.1.tgz
    jupyter labextension install jupyterlab-debugger-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-docmanager-4.5.1.tgz
    jupyter labextension install jupyterlab-docmanager-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-docregistry-4.5.1.tgz
    jupyter labextension install jupyterlab-documentsearch-4.5.1.tgz
    jupyter labextension install jupyterlab-documentsearch-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-extensionmanager-4.5.1.tgz
    jupyter labextension install jupyterlab-extensionmanager-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-filebrowser-4.5.1.tgz
    jupyter labextension install jupyterlab-filebrowser-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-fileeditor-4.5.1.tgz
    jupyter labextension install jupyterlab-fileeditor-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-galata-5.5.1.tgz
    jupyter labextension install jupyterlab-help-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-htmlviewer-4.5.1.tgz
    jupyter labextension install jupyterlab-htmlviewer-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-hub-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-imageviewer-4.5.1.tgz
    jupyter labextension install jupyterlab-imageviewer-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-inspector-4.5.1.tgz
    jupyter labextension install jupyterlab-inspector-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-javascript-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-json-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-launcher-4.5.1.tgz
    jupyter labextension install jupyterlab-launcher-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-logconsole-4.5.1.tgz
    jupyter labextension install jupyterlab-logconsole-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-lsp-4.5.1.tgz
    jupyter labextension install jupyterlab-lsp-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-mainmenu-4.5.1.tgz
    jupyter labextension install jupyterlab-mainmenu-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-markdownviewer-4.5.1.tgz
    jupyter labextension install jupyterlab-markdownviewer-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-markedparser-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-mathjax-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-mermaid-4.5.1.tgz
    jupyter labextension install jupyterlab-mermaid-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-metadataform-4.5.1.tgz
    jupyter labextension install jupyterlab-metadataform-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-metapackage-4.5.1.tgz
    jupyter labextension install jupyterlab-nbconvert-css-4.5.1.tgz
    jupyter labextension install jupyterlab-nbformat-4.5.1.tgz
    jupyter labextension install jupyterlab-notebook-4.5.1.tgz
    jupyter labextension install jupyterlab-notebook-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-observables-5.5.1.tgz
    jupyter labextension install jupyterlab-outputarea-4.5.1.tgz
    jupyter labextension install jupyterlab-pdf-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-pluginmanager-4.5.1.tgz
    jupyter labextension install jupyterlab-pluginmanager-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-property-inspector-4.5.1.tgz
    jupyter labextension install jupyterlab-rendermime-4.5.1.tgz
    jupyter labextension install jupyterlab-rendermime-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-rendermime-interfaces-3.13.1.tgz
    jupyter labextension install jupyterlab-running-4.5.1.tgz
    jupyter labextension install jupyterlab-running-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-services-7.5.1.tgz
    jupyter labextension install jupyterlab-services-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-settingeditor-4.5.1.tgz
    jupyter labextension install jupyterlab-settingeditor-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-settingregistry-4.5.1.tgz
    jupyter labextension install jupyterlab-shortcuts-extension-5.3.1.tgz
    jupyter labextension install jupyterlab-statedb-4.5.1.tgz
    jupyter labextension install jupyterlab-statusbar-4.5.1.tgz
    jupyter labextension install jupyterlab-statusbar-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-template-4.5.1.tgz
    jupyter labextension install jupyterlab-terminal-4.5.1.tgz
    jupyter labextension install jupyterlab-terminal-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-testing-4.5.1.tgz
    jupyter labextension install jupyterlab-testutils-4.5.1.tgz
    jupyter labextension install jupyterlab-theme-dark-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-theme-dark-high-contrast-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-theme-light-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-toc-6.5.1.tgz
    jupyter labextension install jupyterlab-toc-extension-6.5.1.tgz
    jupyter labextension install jupyterlab-tooltip-4.5.1.tgz
    jupyter labextension install jupyterlab-tooltip-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-translation-4.5.1.tgz
    jupyter labextension install jupyterlab-translation-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-ui-components-4.5.1.tgz
    jupyter labextension install jupyterlab-ui-components-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-vega5-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-video-extension-4.5.1.tgz
    jupyter labextension install jupyterlab-workspaces-4.5.1.tgz
    jupyter labextension install jupyterlab-workspaces-extension-4.5.1.tgz

五、安装内核:

(一)、安装java内核:

  1. 安装jdk(openjdk):

  2. 安装ijava:

    shell 复制代码
     cd E:\my_jupyterlab4.5\packages\ijava-1.3.0
     python install.py --prefix=E:\my_jupyterlab4.5\jupyter_venv
     jupyter kernelspec list
  3. 修改配置文件:

    • 文件:E:\my_jupyterlab4.5\jupyter_venv\share\jupyter\kernels\java\kernel.json
    • 修改:将java指定其绝对路径(将\path\to换成自己的真实路径)
    • 内容示例如下:
    json 复制代码
    {
        "argv": [
            "D:\\Program Files\\Java\\jdk-23\\bin\\java.exe",
            "-jar",
            "E:\\my_jupyterlab4.5\\jupyter_venv\\share\\jupyter\\kernels\\java/ijava-1.3.0.jar",
            "{connection_file}"
        ],
        "display_name": "Java",
        "env": {},
        "interrupt_mode": "message",
        "language": "java"
    }

(二)安装javascript

  1. 安装node:

  2. 验证:

    shell 复制代码
    node -v # Should print "v18.20.8".
    # 验证 npm 版本:
    npm -v # Should print "10.8.2".
  3. 设置

    shell 复制代码
    npm config set registry https://repo.huaweicloud.com/repository/npm/
    mkdir D:\apply\node_repo
    mkdir D:\apply\node_repo\node_global
    mkdir D:\apply\node_repo\node_cache
    npm config set prefix "D:\apply\node_repo\node_global"
    npm config set cache "D:\apply\node_repo\node_cache"
    npm install -g zeromq@5.3.1
    npm install -g ijavascript

    进入环境变量对话框,在【系统变量】下新建【NODE_PATH】,

    输入【D:\apply\node_repo\node_global\node_modules】,

    将【用户变量】下的【Path】修改为【D:\apply\node_repo\node_global】

  4. 安装内核:

    shell 复制代码
     cd E:\my_jupyterlab4.5\jupyter_venv
     Scripts\activate
     jupyter kernelspec list
    # 初始化ijavascript内核(关键:让JupyterLab识别)
    
    ijsinstall --install=global

(三)安装typescript(tslab)

  1. 安装node:

  2. 验证:

    shell 复制代码
    node -v # Should print "v20.19.6".
    # 验证 npm 版本:
    npm -v # Should print "10.8.2".
  3. 设置

    shell 复制代码
    npm install -g tslab --location=global

    进入环境变量对话框,在【系统变量】下新建【NODE_PATH】,

    输入【D:\apply\node_repo\node_global\node_modules】,

    将【用户变量】下的【Path】修改为【D:\apply\node_repo\node_global】

  4. 安装内核:

    shell 复制代码
     cd E:\my_jupyterlab4.5\jupyter_venv
     Scripts\activate
     jupyter kernelspec list
     tslab install --prefix E:\my_jupyterlab4.5\jupyter_venv

(四)扩展ijavascript支持typescript

  1. 安装node:

  2. 验证:

    shell 复制代码
    node -v # Should print "v20.19.6".
    # 验证 npm 版本:
    npm -v # Should print "10.8.2".
  3. 设置

    shell 复制代码
    npm install -g ts-node typescript --location=global
    npm install -g itypescript --location=global

    进入环境变量对话框,在【系统变量】下新建【NODE_PATH】,

    输入【D:\apply\node_repo\node_global\node_modules】,

    将【用户变量】下的【Path】修改为【D:\apply\node_repo\node_global】

  4. 安装内核:

    shell 复制代码
     cd E:\my_jupyterlab4.5\jupyter_venv
     Scripts\activate
     jupyter kernelspec list
     # 初始化ijavascript内核(关键:让JupyterLab识别)
    
     # 全局安装(推荐)
     its --install=global
     # 或仅在当前用户目录安装
     its --install=local

六、配置

1. 生成配置文件

复制代码
jupyter-lab build --log-level=10 
jupyter-lab --generate-config

存放路径:C:\Users%USERNAME%.jupyter\jupyter_lab_config.py

2. 生成并保存密码:

shell 复制代码
python -c "from jupyter_server.auth import passwd;print(passwd())"

3. 修改配置文件:

然后修改生成的配置文件 C:\Users%USERNAME%.jupyter\jupyter_lab_config.py 就可以了

python3 复制代码
c.ServerApp.allow_remote_access = False
c.ServerApp.open_browser = True
c.ServerApp.browser = 'C:/Program Files/Google/Chrome/Application/chrome.exe --app=%s'
c.ServerApp.root_dir = "/path/to/my_jupyter/jupyter_data"

c.ServerApp.ip = '0.0.0.0'
c.ServerApp.port = 8888

# c.ServerApp.password = ''
c.PasswordIdentityProvider.hashed_password = "argon2:$arg********A"
c.PasswordIdentityProvider.password_required = True

4. 将配置文件移动到自己的my_jupyter目录下

七、启动

1. 命令行启动

shell 复制代码
# 在命令行中运行  来清除所有临时文件和配置缓存,会删除所有安装的插件
######## jupyter lab clean --all
jupyter-lab build --log-level=10 

cd E:\my_jupyterlab4.5\config
jupyter-lab --config=./config/jupyter_lab_config.py
\path\to\my_jupyter\jupyter_venv\Scripts\jupyter-lab.exe --config=\path\to\my_jupyter\jupyter_lab_config.py

2. 命令行指定root-dir

shell 复制代码
jupyter-lab --config=../jupyter_lab_config.py --notebook-dir=\path\to\my_jupyter\jupyter_data
\path\to\my_jupyter\jupyter_venv\Scripts\jupyter-lab.exe --config=\path\to\my_jupyter\jupyter_lab_config.py  --notebook-dir=\path\to\my_jupyter\jupyter_data

2. 桌面快捷方式

  • 2.1 创建jupyter-lab.exe快捷方式
  • 2.2 修改启动命令,添加参数: --config=\path\to\my_jupyter\jupyter_lab_config.py
  • 2.3 下载一个jupyter-lab图片,使用GIMP2导出为ico
  • 2.4 修改快捷方式的图标

3. 直接下载桌面应用

八、drawio

  1. 下载:
    https://github.com/jgraph/drawio-desktop/releases/latest

  2. jupyterlab使用

    shell 复制代码
    pip install jupyterlab-drawio-render-extension

九、conda包转wheel包

pypi中无法安装的包(需要本地编译,例如y-py需要Rust语言环境),而conda中有编译好的包,

但是不是wheel,需要转换。所以本章节就处理这种包。

  1. 下载:

    • 官网
    • 跳过注册:【Skip registration】
  2. 设置国内源

    shell 复制代码
    # 清华源
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
    conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
    #设置搜索时显示通道地址
    conda config --set show_channel_urls yes
    
    # 中科大镜像源
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/main/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/pkgs/free/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/msys2/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
    conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/menpo/
     #设置搜索时显示通道地址
    conda config --set show_channel_urls yes
  3. 创建虚拟环境:

    shell 复制代码
    cd /path/to/
    conda create --name conda_py312_venv python=3.12
    conda create --name conda_py313_venv python=3.13
    
    conda activate conda_py313_venv
    conda env list
    
    conda install y-py
    
    conda deactivate
  4. 打包环境:

    shell 复制代码
    conda install -c conda-forge conda-pack
    conda pack -n conda_py313_venv -o conda_py313_venv.tar.gz
  5. 下载conda包:

  6. 将conda包转为wheel包(以y-py为例)

    • 下载对应的包:

    • 解压(Git Bash):

      shell 复制代码
      tar -xvjf y-py-0.6.2-py313h636fa0f_2.tar.bz2
      cd ./Lib/site-packages
    • 创建pyproject.toml文件

      复制代码
      [build-system]
      requires = ["setuptools", "wheel"]
      build-backend = "setuptools.build_meta"
      
      [project]
      name = "y-py"
      version = "0.6.2"
      
      [tool.setuptools.packages.find]
      exclude = ["build"]
      [tool.setuptools.package-data]
      "*" = ["*.pyd"]
      "y_py" = ["*.pyd"]
    • 打包为wheel

      shell 复制代码
      pip install build wheel
      python -m build
      python -m build --wheel
      pip install dist\y_py-0.6.2-py3-none-any.whl
    • 安装测试:

      shell 复制代码
      pip install dist\y_py-0.6.2-py3-none-any.whl
    • 验证:

      python 复制代码
      import y_py as Y
      d1 = Y.YDoc()
      print(d1)
  7. 其他包(下面两个包使用的是jupyter-lab3):

    复制代码
    conda install conda-forge::jupyterlab-markup
    conda install conda-forge::jupyterlab-drawio

© 著作权归作者所有

相关推荐
weixin_445054729 小时前
力扣热题52
开发语言·python
weixin_462446239 小时前
Python 使用阿里云 STS 获取临时访问凭证并上传文件至 OSS:Flask API 实现
python·阿里云·flask
橙露9 小时前
从零基础到实战:Python 数据分析三剑客(Pandas+NumPy+Matplotlib)核心应用指南
python·数据分析·pandas
一勺菠萝丶9 小时前
Java 对接 PLC 实战:西门子 PLC 与永宏 PLC 通讯方式全面对比
java·开发语言·python
这就是佬们吗9 小时前
Windows 的 CMD 网络环境:解决终端无法联网与更新的终极指南
java·windows·git·python·spring·maven
栈与堆9 小时前
数据结构篇(1) - 5000字细嗦什么是数组!!!
java·开发语言·数据结构·python·算法·leetcode·柔性数组
企鹅会滑雪9 小时前
【无标题】
开发语言·python
寻星探路9 小时前
【深度长文】深入理解网络原理:TCP/IP 协议栈核心实战与性能调优
java·网络·人工智能·python·网络协议·tcp/ip·ai
轻竹办公PPT9 小时前
实测多款 AI:2026 年工作计划 PPT 哪种更好修改
人工智能·python·powerpoint